add RunEcho()
This commit is contained in:
parent
cb04f3585c
commit
c1e3282864
17
shell.go
17
shell.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue