diff options
Diffstat (limited to 'commands/comment.go')
-rw-r--r-- | commands/comment.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/commands/comment.go b/commands/comment.go index ebbeaa77..cebf729c 100644 --- a/commands/comment.go +++ b/commands/comment.go @@ -2,9 +2,10 @@ package commands import ( "errors" + "fmt" "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/bug/operations" - "github.com/MichaelMure/git-bug/commands/input" + "github.com/MichaelMure/git-bug/input" "github.com/spf13/cobra" ) @@ -32,8 +33,13 @@ func runComment(cmd *cobra.Command, args []string) error { return err } } - if commentMessageFile == "" && commentMessage == "" { - commentMessage, err = input.LaunchEditor(repo, messageFilename) + + if commentMessage == "" { + commentMessage, err = input.BugCommentEditorInput(repo, messageFilename) + if err == input.ErrEmptyMessage { + fmt.Println("Empty message, aborting.") + return nil + } if err != nil { return err } |