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 gitdomain.LocalBranchName, printBranch bool, env []string, ...) string
- func PrintCommand(branch gitdomain.LocalBranchName, printBranch bool, env []string, cmd 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) RunWithEnv(env []string, executable string, args ...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 gitdomain.LocalBranchName, printBranch bool, env []string, cmd string, args ...string)
PrintCommand prints the given command-line operation on the console.
Types ¶
type BackendRunner ¶
type BackendRunner struct {
CommandsCounter Mutable[gohacks.Counter]
// If set, runs the commands in the given directory.
// If not set, runs the commands in the current working directory.
Dir Option[string]
// whether to print the executed commands to the CLI
Verbose configdomain.Verbose
}
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) RunWithEnv ¶ added in v20.2.0
func (self BackendRunner) RunWithEnv(env []string, executable string, args ...string) error
type FrontendDryRunner ¶
type FrontendDryRunner struct {
Backend gitdomain.Querier
CommandsCounter Mutable[gohacks.Counter]
GetCurrentBranch GetCurrentBranchFunc
PrintBranchNames bool
PrintCommands bool
}
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(cmd string, args ...string) error
func (*FrontendDryRunner) RunWithEnv ¶ added in v20.2.0
func (self *FrontendDryRunner) RunWithEnv(env []string, cmd string, args ...string) error
type FrontendRunner ¶
type FrontendRunner struct {
Backend gitdomain.Querier
CommandsCounter Mutable[gohacks.Counter]
GetCurrentBranch GetCurrentBranchFunc
PrintBranchNames bool
PrintCommands bool
}
FrontendRunner executes frontend shell commands.
func (*FrontendRunner) RunWithEnv ¶ added in v20.2.0
func (self *FrontendRunner) RunWithEnv(env []string, cmd string, args ...string) error
type GetCurrentBranchFunc ¶
type GetCurrentBranchFunc func(gitdomain.Querier) (gitdomain.LocalBranchName, error)
Click to show internal directories.
Click to hide internal directories.