Skip to content

Commit

Permalink
Fix broken .helmsman-tmp cleanup caused by os.Exit not respectng clea…
Browse files Browse the repository at this point in the history
…nup defer
  • Loading branch information
mkubaczyk committed Jul 27, 2022
1 parent a849965 commit 355c6e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/helmsman/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package main

import (
"github.com/Praqma/helmsman/internal/app"
"os"
)

func main() {
app.Main()
exitCode := app.Main()
os.Exit(exitCode)
}
4 changes: 2 additions & 2 deletions internal/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {
}

// Main is the app main function
func Main() {
func Main() int {
var s State

flags.parse()
Expand Down Expand Up @@ -141,5 +141,5 @@ func Main() {
exitCode = exitCodeSucceedWithChanges
}

os.Exit(exitCode)
return exitCode
}

0 comments on commit 355c6e0

Please sign in to comment.