43 lines
893 B
Go
43 lines
893 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"go.wit.com/lib/gui/shell"
|
|
"go.wit.com/log"
|
|
)
|
|
|
|
func doesExist(path string) bool {
|
|
if _, err := os.Stat(path); err != nil {
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
// only errors on bad errors
|
|
func quickCmd(fullpath string, cmd []string) bool {
|
|
if me.autoDryRun.Checked() {
|
|
log.Warn("RUN --dry-run", fullpath, cmd)
|
|
return false
|
|
} else {
|
|
log.Warn("RUN:", fullpath, cmd)
|
|
}
|
|
|
|
result := shell.PathRun(fullpath, cmd)
|
|
if result.Error != nil {
|
|
log.Warn("quickCmd() cmd =", cmd)
|
|
log.Warn("quickCmd() err =", result.Error)
|
|
log.Warn("quickCmd() b =", result.Exit)
|
|
log.Warn("quickCmd() output =", result.Stdout)
|
|
return false
|
|
} else if result.Exit != 0 {
|
|
log.Warn("quickCmd() b =", result.Exit)
|
|
log.Warn("quickCmd() output =", result.Stdout)
|
|
return true
|
|
}
|
|
log.Warn("quickCmd() output = ", result.Stdout)
|
|
return true
|
|
}
|