From 7a511f9a13f3d1064fd11c9146e6b21cb961a8b2 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 17 Oct 2018 20:38:10 +0200 Subject: commands: don't load the repo for commands that don't need it fix #67 --- commands/comment_add.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'commands/comment_add.go') diff --git a/commands/comment_add.go b/commands/comment_add.go index 8736f9c2..6ee3fc15 100644 --- a/commands/comment_add.go +++ b/commands/comment_add.go @@ -53,9 +53,10 @@ func runCommentAdd(cmd *cobra.Command, args []string) error { } var commentAddCmd = &cobra.Command{ - Use: "add []", - Short: "Add a new comment", - RunE: runCommentAdd, + Use: "add []", + Short: "Add a new comment", + PreRunE: loadRepo, + RunE: runCommentAdd, } func init() { -- cgit