mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
refactor: small changes to exit and usage statement
This commit is contained in:
@@ -56,5 +56,5 @@ var czCmd = &cobra.Command{
|
||||
func init() {
|
||||
rootCmd.AddCommand(czCmd)
|
||||
czCmd.Flags().BoolP("print", "p", false, "Print the commit message")
|
||||
czCmd.Flags().BoolP("cli", "c", false, "Use the cli style syntax to add co-authors")
|
||||
czCmd.Flags().BoolP("cli", "c", false, "[co-author1] [co-author2] ...")
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Cz_Call() string {
|
||||
@@ -18,6 +19,10 @@ func Cz_Call() string {
|
||||
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
// if the user exits the commitizen command, exit the program
|
||||
if strings.Contains(err.Error(), "exit status 8") {
|
||||
os.Exit(0)
|
||||
}
|
||||
panic(fmt.Sprint(err))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user