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 string, omitBranch bool, executable string, args ...string) string
- func PrintCommand(branch string, omitBranch bool, cmd string, args ...string)
- type BackendRunner
- type FrontendDryRunner
- type FrontendRunner
- type Statistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorDetails ¶
func FormatCommand ¶
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 Stats Statistics // whether to print the executed commands to the CLI Verbose bool }
BackendRunner executes backend shell commands without output to the CLI.
func (BackendRunner) Run ¶
func (r BackendRunner) Run(executable string, args ...string) (string, error)
func (BackendRunner) RunMany ¶
func (r 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 { CurrentBranch *cache.String OmitBranchNames bool Stats Statistics }
FrontendDryRunner prints the given shell commands to the CLI as if they were executed but does not execute them.
func (*FrontendDryRunner) Run ¶
func (r *FrontendDryRunner) Run(executable string, args ...string) error
Run runs the given command in this ShellRunner's directory.
func (*FrontendDryRunner) RunMany ¶
func (r *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.
func (*FrontendDryRunner) RunString ¶
func (r *FrontendDryRunner) RunString(fullCmd string) error
RunString runs the given command (including possible arguments) in this ShellInDir's directory.
type FrontendRunner ¶
type FrontendRunner struct { CurrentBranch *cache.String OmitBranchNames bool Stats Statistics }
FrontendRunner executes frontend shell commands.
func (*FrontendRunner) Run ¶
func (r *FrontendRunner) Run(cmd string, args ...string) error
Run runs the given command in this ShellRunner's directory.
func (*FrontendRunner) RunMany ¶
func (r *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 Statistics ¶
type Statistics interface {
RegisterRun()
}