From 34fc3457d681b3f69f531bb5001051a5e050b106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 8 May 2020 18:06:05 +0200 Subject: [PATCH] Skip interactive mode in `pr create` if title & body were passed This matches `issue create` behavior 4b32e3f2159bec8e7e1d1e9c514062d8fd3f5c64 --- command/pr_create.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command/pr_create.go b/command/pr_create.go index 29762de0b..9a6e165ee 100644 --- a/command/pr_create.go +++ b/command/pr_create.go @@ -208,8 +208,9 @@ func prCreate(cmd *cobra.Command, _ []string) error { Milestone: milestoneTitle, } - // TODO: only drop into interactive mode if stdin & stdout are a tty - if !isWeb && !autofill && (title == "" || body == "") { + interactive := !(cmd.Flags().Changed("title") && cmd.Flags().Changed("body")) + + if !isWeb && !autofill && interactive { var templateFiles []string if rootDir, err := git.ToplevelDir(); err == nil { // TODO: figure out how to stub this in tests