Skip interactive mode in pr create if title & body were passed

This matches `issue create` behavior 4b32e3f215
This commit is contained in:
Mislav Marohnić 2020-05-08 18:06:05 +02:00
parent cedf94f450
commit 34fc3457d6

View file

@ -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