diff options
| author | Jeff Carr <[email protected]> | 2024-12-10 01:48:49 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-10 01:48:49 -0600 |
| commit | c1e32828642c500fa621dc819b9be03ab6a4b5ad (patch) | |
| tree | e0a93489b1ce853744919d4448e8d5c28f2ab401 /shell.go | |
| parent | cb04f3585c1abe95f6bddfa282e829896c2bb19a (diff) | |
add RunEcho()
Diffstat (limited to 'shell.go')
| -rw-r--r-- | shell.go | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -25,11 +25,18 @@ func (repo *Repo) Run(cmd []string) cmd.Status { func (repo *Repo) RunQuiet(cmd []string) cmd.Status { result := shell.PathRunQuiet(repo.FullPath, cmd) - output := strings.Join(result.Stdout, "\n") - if result.Error != nil { - log.Warn("cmd:", cmd) - log.Warn("ouptput:", output) - log.Warn("failed with error:", result.Error) + return result +} + +func (repo *Repo) RunEcho(cmd []string) cmd.Status { + result := shell.PathRunQuiet(repo.FullPath, cmd) + log.Info("cmd:", repo.FullPath, cmd) + log.Warn("cmd.Exit:", result.Exit, "cmd.Error:", result.Error) + for _, line := range result.Stdout { + log.Info("STDOUT:", line) + } + for _, line := range result.Stderr { + log.Info("STDERR:", line) } return result } |
