Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Run = func(command string) int { cmd := exec.Command("bash", "-c", command) var waitStatus syscall.WaitStatus if err := cmd.Run(); err != nil { if exitError, ok := err.(*exec.ExitError); ok { waitStatus = exitError.Sys().(syscall.WaitStatus) return waitStatus.ExitStatus() } } return 0 }
Run takes a command and returns the system status code that results from running said command via bash.
Functions ¶
This section is empty.
Types ¶
type ExecService ¶
type ExecService struct{}
ExecService is a service that knows how to execute external commands via bash.
func NewExecService ¶
func NewExecService() *ExecService
NewExecService creates and returns a new ExecService instance.
func (*ExecService) Run ¶
func (service *ExecService) Run(command string) int
Run takes a command and returns the result of running it with bash.Run.
Click to show internal directories.
Click to hide internal directories.