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)
}
if r := shell.Run(cmd); r.Error == nil {
log.Warn("go build worked")
} else {
r := shell.Run(cmd)
if r.Exit != 0 {
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())