Skip to content

Commit

Permalink
Skip interactive mode in pr create if title & body were passed
Browse files Browse the repository at this point in the history
This matches `issue create` behavior 4b32e3f
  • Loading branch information
mislav committed May 8, 2020
1 parent cedf94f commit 34fc345
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions command/pr_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34fc345

Please sign in to comment.