Skip to content

Commit

Permalink
Fix missing error checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Feb 8, 2023
1 parent 29852e2 commit 9e01484
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ Delete all build artifacts. Use --all to also clean the cache/ directory.
if priv {
cmd = fmt.Sprintf("sudo %s", cmd)
}
bashexec.Run("cleanup cache", cmd)
if err := bashexec.Run("cleanup cache", cmd); err != nil {
return err
}
} else {
fmt.Println("Note: retaining cache/")
}
Expand Down
4 changes: 3 additions & 1 deletion internal/pkg/cosash/cosash.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func (sh *CosaSh) Process(buf string) error {
// PrepareBuild prepares for a build, returning the newly allocated build directory
func (sh *CosaSh) PrepareBuild(artifact_name string) (string, error) {
if artifact_name != "" {
sh.Process(fmt.Sprintf("IMAGE_TYPE=%s", artifact_name))
if err := sh.Process(fmt.Sprintf("IMAGE_TYPE=%s", artifact_name)); err != nil {
return "", err
}
}
return sh.ProcessWithReply(`prepare_build
pwd >&3
Expand Down

0 comments on commit 9e01484

Please sign in to comment.