diff options
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | doGit.go | 18 | ||||
| -rw-r--r-- | main.go | 7 |
3 files changed, 19 insertions, 9 deletions
@@ -71,6 +71,9 @@ apt-update: -o Dir::Etc::sourceparts=/dev/null \ -o APT::Get::List-Cleanup=0 +commit: + forge commit --all + merge: forge merge --all @@ -15,7 +15,7 @@ import ( "go.wit.com/log" ) -func doGit() error { +func doGit() (string, error) { log.DaemonMode(true) defer log.DaemonMode(false) @@ -23,7 +23,7 @@ func doGit() error { fstr := "--format=\"%h %>(24)%ar %>(20)%an %s" cmd := []string{"git", "log", fstr} shell.RunVerbose(cmd) - me.sh.GoodExit("") + return "git log", nil } if argv.Git.Tag != nil { @@ -35,6 +35,7 @@ func doGit() error { parts := strings.Split(line, "\x00") log.Infof("LINE: %d len(%d) %v\n", i, len(parts), parts) } + return "git tags", nil } if argv.Git.Who != nil { @@ -48,19 +49,19 @@ func doGit() error { } cmd := []string{"git", "who"} shell.RunVerbose(cmd) - me.sh.GoodExit("") + return "git who", nil } if argv.Git.Pull != nil { doPull(".config/wit") doPull("tools") - me.sh.GoodExit("") + return "git pull", nil } if argv.Git.Push != nil { doPush(".config/wit") doPush("tools") - me.sh.GoodExit("") + return "git push", nil } if argv.Git.DeleteUntracked { @@ -77,13 +78,16 @@ func doGit() error { cmd := []string{"rm"} cmd = append(cmd, files...) _, err := fhelp.RunRealtimeError(cmd) - return err + if err != nil { + log.Info("cmd failed", cmd, repo.FullPath, err) + return "rm failed", err + } } } } } - return nil + return "todo: put something here", nil } func findRepo(wpath string) (*gitpb.Repo, bool) { @@ -43,8 +43,11 @@ func main() { } if argv.Git != nil { - doGit() - me.sh.GoodExit("") + s, err := doGit() + if err != nil { + me.sh.BadExit(s, err) + } + me.sh.GoodExit(s) } if argv.Clone != nil { |
