Skip to content

Commit

Permalink
fix(exit-code): catch exit code
Browse files Browse the repository at this point in the history
In some case, the program exit with error and exit code of zero. Change this to exit with non zero code each
time the list of error is not empty.
  • Loading branch information
Xaving committed Jun 24, 2024
1 parent fba6181 commit 928ec06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@ func main() {
fmt.Fprintf(os.Stderr, "[helm-sops] Error: %s\n", err)
}

if len(w.Errors) > 0 && w.ExitCode == 0 {
w.ExitCode = 1
}

os.Exit(w.ExitCode)
}

0 comments on commit 928ec06

Please sign in to comment.