exec

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package exec provides the shared subprocess-runner interface used by the rest of the codebase to invoke git, gh, and tmux without binding production call sites to os/exec directly. Tests inject fakes; production uses Default.

Kept as a leaf package so both cmd/ and session/git/ can import it without creating a cycle (cmd/ imports session/git/).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(c *exec.Cmd) string

ToString renders a command for logs in "argv joined by spaces" form.

Types

type Default

type Default struct{}

Default is the production Executor that forwards directly to *exec.Cmd.

func (Default) CombinedOutput

func (Default) CombinedOutput(c *exec.Cmd) ([]byte, error)

func (Default) Output

func (Default) Output(c *exec.Cmd) ([]byte, error)

func (Default) Run

func (Default) Run(c *exec.Cmd) error

type Executor

type Executor interface {
	Run(c *exec.Cmd) error
	Output(c *exec.Cmd) ([]byte, error)
	CombinedOutput(c *exec.Cmd) ([]byte, error)
}

Executor runs *exec.Cmd values. Production callers use Default; tests substitute a recorder or an in-memory fake.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL