diff options
| author | Jeff Carr <[email protected]> | 2024-02-11 04:09:48 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-11 04:09:48 -0600 |
| commit | 732102f7942ec8ad5d55bb023b9c87065848b204 (patch) | |
| tree | fe086b5d36870257dd21df42e4e78be0650b5e15 /run.go | |
| parent | c877c3886d804a9eadb22657403f574684c024f5 (diff) | |
all of this is terriblev0.20.3
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'run.go')
| -rw-r--r-- | run.go | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -21,9 +21,25 @@ var msecDelay int = 20 // check every 20 milliseconds // use go-cmd instead here? // exiterr.Sys().(syscall.WaitStatus) +// run command and return it's output +func RunCapture(cmdline string) string { + test := New() + test.Exec(cmdline) + return Chomp(test.Buffer) +} + +func RunWait(args []string) *Shell { + test := New() + cmdline := strings.Join(args, " ") + test.Exec(cmdline) + return test +} + // var newfile *shell.File func RunString(args string) bool { - return false + // return false + parts := strings.Split(args, " ") + return Run(parts) } func Run(args []string) bool { @@ -36,6 +52,7 @@ func Run(args []string) bool { return RunPath(dir, args) } +// run, but set the working path func RunPath(path string, args []string) bool { if len(args) == 0 { log.Warn("command line was empty") |
