Skip to content

Commit

Permalink
fix: Exit with code 1 upon errors in the CLI (#243)
Browse files Browse the repository at this point in the history
The CLI exits with 0 even after errors. This is an issue for scripting.
This change fixes that.
  • Loading branch information
laurentluce authored Sep 23, 2024
1 parent 2f4a3e5 commit 63c640e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kardinal-cli/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package main

import "kardinal.cli/cmd"
import (
"fmt"
"os"

"kardinal.cli/cmd"
)

func main() {

if err := cmd.Execute(); err != nil {
println("Error:", err.Error())
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}

0 comments on commit 63c640e

Please sign in to comment.