From 00628fbf2dcf4c340162b0231d2eba38be5fe334 Mon Sep 17 00:00:00 2001 From: AllanCapistrano Date: Thu, 20 Jul 2023 14:27:43 -0300 Subject: [PATCH] fix: allows the escape button to cancel the action --- cmd/root.go | 4 ++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 0569e72..f507e4a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -79,6 +79,10 @@ simple way to write commits following the Conventional Commits commitType := commitTypeMenu.Display() + if commitType == "" { + os.Exit(0) + } + if enableEmojis { var commitTypeEmoji string diff --git a/go.mod b/go.mod index 3f1c3aa..ac7bf6b 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( ) require ( - github.com/buger/goterm v1.0.3 // indirect + github.com/buger/goterm v1.0.4 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/pkg/term v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/go.sum b/go.sum index b43e383..368a8c1 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/buger/goterm v1.0.3 h1:7V/HeAQHrzPk/U4BvyH2g9u+xbUW9nr4yRPyG59W4fM= -github.com/buger/goterm v1.0.3/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= +github.com/buger/goterm v1.0.4 h1:Z9YvGmOih81P0FbVtEYTFF6YsSgxSUKEhf/f9bTMXbY= +github.com/buger/goterm v1.0.4/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=