Documentation ¶
Overview ¶
Package subshell provides facilities to execute CLI commands in subshells.
Index ¶
- func ErrorDetails(executable string, args []string, err error, output []byte) error
- func FormatCommand(currentBranch domain.LocalBranchName, omitBranch bool, executable string, ...) string
- func PrintCommand(branch domain.LocalBranchName, omitBranch bool, cmd string, args ...string)
- type BackendRunner
- func (self BackendRunner) Query(executable string, args ...string) (string, error)
- func (self BackendRunner) QueryTrim(executable string, args ...string) (string, error)
- func (self BackendRunner) Run(executable string, args ...string) error
- func (self BackendRunner) RunMany(commands [][]string) error
- type FrontendDryRunner
- type FrontendRunner
- type GetCurrentBranchFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorDetails ¶
func FormatCommand ¶
func PrintCommand ¶
func PrintCommand(branch domain.LocalBranchName, omitBranch bool, cmd string, args ...string)
PrintCommand prints the given command-line operation on the console.
Types ¶
type BackendRunner ¶
type BackendRunner struct { // If set, runs the commands in the given directory. // If not set, runs the commands in the current working directory. Dir *string CommandsCounter *gohacks.Counter // whether to print the executed commands to the CLI Verbose bool }
BackendRunner executes backend shell commands without output to the CLI.
func (BackendRunner) Query ¶
func (self BackendRunner) Query(executable string, args ...string) (string, error)
func (BackendRunner) QueryTrim ¶
func (self BackendRunner) QueryTrim(executable string, args ...string) (string, error)
func (BackendRunner) RunMany ¶
func (self BackendRunner) RunMany(commands [][]string) error
RunMany runs all given commands in current directory. Commands are provided as a list of argv-style strings. Failed commands abort immediately with the encountered error.
type FrontendDryRunner ¶
type FrontendDryRunner struct { GetCurrentBranch GetCurrentBranchFunc OmitBranchNames bool PrintCommands bool CommandsCounter *gohacks.Counter }
FrontendDryRunner prints the given shell commands to the CLI as if they were executed but does not execute them.
func (*FrontendDryRunner) Run ¶
func (self *FrontendDryRunner) Run(executable string, args ...string) error
Run runs the given command in this ShellRunner's directory.
func (*FrontendDryRunner) RunMany ¶
func (self *FrontendDryRunner) RunMany(commands [][]string) error
RunMany runs all given commands in current directory. Commands are provided as a list of argv-style strings. Failed commands abort immediately with the encountered error.
type FrontendRunner ¶
type FrontendRunner struct { GetCurrentBranch GetCurrentBranchFunc OmitBranchNames bool PrintCommands bool CommandsCounter *gohacks.Counter }
FrontendRunner executes frontend shell commands.
func (*FrontendRunner) Run ¶
func (self *FrontendRunner) Run(cmd string, args ...string) (err error)
Run runs the given command in this ShellRunner's directory.
func (*FrontendRunner) RunMany ¶
func (self *FrontendRunner) RunMany(commands [][]string) error
RunMany runs all given commands in current directory. Commands are provided as a list of argv-style strings. Failed commands abort immediately with the encountered error.
type GetCurrentBranchFunc ¶
type GetCurrentBranchFunc func() (domain.LocalBranchName, error)