Skip to content

Commit

Permalink
Merge pull request #693 from Praqma/fix-tmp-cleanup
Browse files Browse the repository at this point in the history
Fix broken .helmsman-tmp cleanup caused by os.Exit not respectng cleanup defer
  • Loading branch information
mkubaczyk authored Jul 27, 2022
2 parents a849965 + 355c6e0 commit f337837
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 f337837

Please sign in to comment.