remove dependency on model

This commit is contained in:
Jesse Duffield 2022-12-27 22:52:20 +11:00
parent c5050ecabd
commit ed93e0a2b0
32 changed files with 200 additions and 178 deletions

View file

@ -38,6 +38,17 @@ func (self *Shell) RunCommand(cmdStr string) *Shell {
return self
}
func (self *Shell) runCommandWithOutput(cmdStr string) (string, error) {
args := str.ToArgv(cmdStr)
cmd := secureexec.Command(args[0], args[1:]...)
cmd.Env = os.Environ()
cmd.Dir = self.dir
output, err := cmd.CombinedOutput()
return string(output), err
}
func (self *Shell) RunShellCommand(cmdStr string) *Shell {
cmd := secureexec.Command("sh", "-c", cmdStr)
cmd.Env = os.Environ()