Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions command/pr_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,18 @@ func prCreate(cmd *cobra.Command, _ []string) error {
}
}

isDraft, err := cmd.Flags().GetBool("draft")
if err != nil {
return fmt.Errorf("could not parse draft: %w", err)
}

if !isWeb && !autofill {
fmt.Fprintf(colorableErr(cmd), "\nCreating pull request for %s into %s in %s\n\n",
message := "\nCreating pull request for %s into %s in %s\n\n"
if isDraft {
message = "\nCreating draft pull request for %s into %s in %s\n\n"
}

fmt.Fprintf(colorableErr(cmd), message,
utils.Cyan(headBranch),
utils.Cyan(baseBranch),
ghrepo.FullName(baseRepo))
Expand Down Expand Up @@ -245,10 +255,6 @@ func prCreate(cmd *cobra.Command, _ []string) error {
return errors.New("pull request title must not be blank")
}

isDraft, err := cmd.Flags().GetBool("draft")
if err != nil {
return fmt.Errorf("could not parse draft: %w", err)
}
if isDraft && isWeb {
return errors.New("the --draft flag is not supported with --web")
}
Expand Down