This commit is contained in:
parent
0e6ef50ad2
commit
1ba66e4e54
|
@ -1,42 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
Loading…
Reference in New Issue