Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousLearner committed Aug 29, 2024
1 parent 2a41bd6 commit 288faed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,15 @@ func checkForUpdate(ctx context.Context, currentVersion string) (*version.Releas
return version.CheckForUpdate(ctx, http.DefaultClient, stateFilePath, repo, currentVersion)
}

func exitWithCode(code int) {
os.Exit(code)
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
retcode := 0
defer func() { os.Exit(retcode) }
defer exitWithCode(retcode)

// start update check process in the background
ctx := context.Background()
Expand Down

0 comments on commit 288faed

Please sign in to comment.