diff options
| author | Jeff Carr <[email protected]> | 2025-01-05 12:14:36 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-05 12:14:36 -0600 |
| commit | de75f951617e8259b749339934d449b79e0edc30 (patch) | |
| tree | 41121a73a96a3672942c382d856ccf039f1a53ba /shell.go | |
| parent | 6112d6e29899ec491150c0d346d66234badd8cdc (diff) | |
| parent | 22b157f6d7a269bd592c5d907ca2e8c0d189928e (diff) | |
Merge branch 'jcarr' into devel
Diffstat (limited to 'shell.go')
| -rw-r--r-- | shell.go | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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 +} |
