diff options
| author | Jeff Carr <[email protected]> | 2024-01-24 16:24:58 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-24 16:24:58 -0600 |
| commit | 21546ce2c002e1550754578b1083f0a9c6d0a77d (patch) | |
| tree | 57d3795e0fc094a26cf9c463ff97ac5d7a63d30a /unix.go | |
| parent | 732ac4b1e5f7b23873ec7a09bfa4cffcc501a8a8 (diff) | |
more attempts to release versions
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -10,6 +10,7 @@ import ( "path/filepath" "regexp" "strings" + "syscall" "go.wit.com/log" ) @@ -115,6 +116,17 @@ func splitVersion(version string) (a, b, c string) { } } +func (rs *RepoStatus) RunCmd(parts []string) (error, string) { + path := rs.realPath.String() + err, _, output := RunCmd(path, parts) + if err != nil { + log.Log(WARN, "cmd:", parts) + log.Log(WARN, "ouptput:", output) + log.Log(WARN, "failed with error:", err) + } + return err, output +} + // temp hack. fix this func runCmd(path string, parts []string) (error, bool, string) { return RunCmd(path, parts) @@ -162,6 +174,16 @@ func RunCmd(workingpath string, parts []string) (error, bool, string) { log.Warn("cmd exited with error", err) // panic("fucknuts") return err, false, string(output) + + // The command failed (non-zero exit status) + if exitErr, ok := err.(*exec.ExitError); ok { + // Assert that it is an exec.ExitError and get the exit code + if status, ok := exitErr.Sys().(syscall.WaitStatus); ok { + log.Warn("Exit Status: %d\n", status.ExitStatus()) + } + } else { + log.Warn("cmd.Run() failed with %s\n", err) + } } tmp := string(output) |
