autotypist/shell.go

41 lines
779 B
Go

package main
import (
"go.wit.com/log"
"go.wit.com/lib/gui/repostatus"
)
// only errors on bad errors
func quickCmd(fullpath string, cmd []string) bool {
var err error
var b bool
var output string
// if me.autoWorkingPwd.String() != fullpath {
// me.autoWorkingPwd.SetValue(fullpath)
// }
if me.autoDryRun.Checked() {
log.Warn("RUN --dry-run", fullpath, cmd)
return false
} else {
log.Warn("RUN:", fullpath, cmd)
}
err, b, output = repostatus.RunCmd(fullpath, cmd)
if err != nil {
log.Warn("cmd =", cmd)
log.Warn("err =", err)
log.Warn("b =", b)
log.Warn("output =", string(output))
return false
} else if !b {
log.Warn("b =", b)
log.Warn("output =", string(output))
return true
}
log.Warn("output = ", string(output))
return true
}