Documentation
¶
Overview ¶
Package subshell provides facilities to execute CLI commands in subshells.
Index ¶
- Constants
- func ErrorDetails(executable string, args []string, err error, output []byte) error
- func FormatCommand(location gitdomain.Location, printBranch bool, env []string, executable string, ...) string
- func IsInTest() bool
- func PrintCommand(location gitdomain.Location, 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
- type GetCurrentSHAFunc
Constants ¶
View Source
const TestToken = "GIT_TOWN_TEST"
Variables ¶
This section is empty.
Functions ¶
func ErrorDetails ¶
func FormatCommand ¶
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 ¶
func (self BackendRunner) RunWithEnv(env []string, executable string, args ...string) error
type FrontendDryRunner ¶
type FrontendDryRunner struct {
Backend subshelldomain.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 ¶
func (self *FrontendDryRunner) RunWithEnv(env []string, cmd string, args ...string) error
type FrontendRunner ¶
type FrontendRunner struct {
Backend subshelldomain.Querier
CommandsCounter Mutable[gohacks.Counter]
GetCurrentBranch GetCurrentBranchFunc
GetCurrentSHA GetCurrentSHAFunc
PrintBranchNames bool
PrintCommands bool
}
FrontendRunner executes frontend shell commands.
func (*FrontendRunner) RunWithEnv ¶
func (self *FrontendRunner) RunWithEnv(env []string, cmd string, args ...string) error
type GetCurrentBranchFunc ¶
type GetCurrentBranchFunc func(subshelldomain.Querier) (Option[gitdomain.LocalBranchName], error)
type GetCurrentSHAFunc ¶
type GetCurrentSHAFunc func(subshelldomain.Querier) (gitdomain.SHA, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package subshelldomain defines types around subshells.
|
Package subshelldomain defines types around subshells. |
Click to show internal directories.
Click to hide internal directories.