diff options
Diffstat (limited to 'commands/new.go')
-rw-r--r-- | commands/new.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/commands/new.go b/commands/new.go index 9844e121..4168453e 100644 --- a/commands/new.go +++ b/commands/new.go @@ -44,18 +44,20 @@ func runNewBug(cmd *cobra.Command, args []string) error { return err } - newBug := bug.NewBug() - - createOp := operations.NewCreateOp(author, title, newMessage) - - newBug.Append(createOp) + newBug, err := operations.Create(author, title, newMessage) + if err != nil { + return err + } err = newBug.Commit(repo) - fmt.Printf("%s created\n", newBug.HumanId()) + if err != nil { + return err + } - return err + fmt.Printf("%s created\n", newBug.HumanId()) + return nil } var newCmd = &cobra.Command{ |