terminate build correctly on failure

This commit is contained in:
Jeff Carr 2024-12-04 02:24:34 -06:00
parent afe21d3c62
commit bcd19ae72b
1 changed files with 7 additions and 3 deletions

View File

@ -94,11 +94,15 @@ func (c *controlBox) buildPackage() (bool, error) {
cmd = append(cmd, "-ldflags", "-X "+flag) cmd = append(cmd, "-ldflags", "-X "+flag)
} }
if r := shell.Run(cmd); r.Error == nil { r := shell.Run(cmd)
log.Warn("go build worked") if r.Exit != 0 {
} else {
return false, errors.New("go build") return false, errors.New("go build")
} }
if r.Error != nil {
return false, errors.New("go build")
}
log.Warn("go build worked")
return true, nil
} }
filebase := filepath.Base(c.pathL.String()) filebase := filepath.Base(c.pathL.String())