use go-cmd/cmd
This commit is contained in:
parent
b33280b869
commit
169d2127da
|
@ -122,7 +122,7 @@ func (r *repoWindow) repoMenu() *gui.Node {
|
|||
r.Disable()
|
||||
defer r.Enable()
|
||||
for _, repo := range r.View.AllRepos() {
|
||||
repo.RunCmd([]string{"git", "pull"})
|
||||
repo.Run([]string{"git", "pull"})
|
||||
}
|
||||
})
|
||||
|
||||
|
|
32
shell.go
32
shell.go
|
@ -1,21 +1,14 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"go.wit.com/log"
|
||||
"strings"
|
||||
|
||||
"go.wit.com/lib/gui/repostatus"
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/lib/gui/shell"
|
||||
)
|
||||
|
||||
// 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
|
||||
|
@ -23,18 +16,19 @@ func quickCmd(fullpath string, cmd []string) bool {
|
|||
log.Warn("RUN:", fullpath, cmd)
|
||||
}
|
||||
|
||||
err, b, output = repostatus.RunCmd(fullpath, cmd)
|
||||
if err != nil {
|
||||
r := shell.PathRun(fullpath, cmd)
|
||||
output := strings.TrimSpace(strings.Join(r.Stdout, "\n"))
|
||||
if r.Error != nil {
|
||||
log.Warn("cmd =", cmd)
|
||||
log.Warn("err =", err)
|
||||
log.Warn("b =", b)
|
||||
log.Warn("output =", string(output))
|
||||
log.Warn("err =", r.Error)
|
||||
log.Warn("b =", r.Exit)
|
||||
log.Warn("output =", output)
|
||||
return false
|
||||
} else if !b {
|
||||
log.Warn("b =", b)
|
||||
log.Warn("output =", string(output))
|
||||
} else if r.Exit != 0 {
|
||||
log.Warn("b =", r.Exit)
|
||||
log.Warn("output =", output)
|
||||
return true
|
||||
}
|
||||
log.Warn("output = ", string(output))
|
||||
log.Warn("output = ", output)
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue