From 22b157f6d7a269bd592c5d907ca2e8c0d189928e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 5 Jan 2025 12:02:54 -0600 Subject: add merge things --- shell.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'shell.go') diff --git a/shell.go b/shell.go index c9ea1ed..15fab39 100644 --- a/shell.go +++ b/shell.go @@ -65,6 +65,19 @@ func (repo *Repo) StrictRun(cmd []string) error { return nil } +func (repo *Repo) RunStrictNew(cmd []string) (*cmd.Status, error) { + result := repo.RunQuiet(cmd) + if result.Error != nil { + log.Warn(repo.GetGoPath(), cmd, "wow. golang is cool. an os.Error:", result.Error) + return &result, result.Error + } + if result.Exit != 0 { + log.Warn(cmd, "failed with", result.Exit) + return &result, errors.New(fmt.Sprint(cmd, "failed with", result.Exit)) + } + return nil, nil +} + func (repo *Repo) Exists(filename string) bool { if repo == nil { return false @@ -121,3 +134,13 @@ func (repo *Repo) RunAll(all [][]string) bool { } return true } + +func (repo *Repo) RunStrictAll(all [][]string) (*cmd.Status, error) { + for _, cmd := range all { + log.Log(GITPBWARN, "doAll() RUNNING: cmd =", cmd) + if result, err := repo.RunStrictNew(cmd); err != nil { + return result, err + } + } + return nil, nil +} -- cgit v1.2.3