Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
fix(pull-request): release 'If use_editor setting is false don't open…
Browse files Browse the repository at this point in the history
… the editor'
  • Loading branch information
protoEvangelion committed Jan 29, 2020
1 parent 3ce2980 commit b445566
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/cmds/pull-request/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ export async function submit(options, user) {
}

if (userLeftMsgEmpty(title)) {
title = useEditor ?
openFileInEditor('temp-gh-pr-title.txt', `# Add a pr title message on the next line\n`)
title = useEditor
? openFileInEditor(
'temp-gh-pr-title.txt',
`# Add a pr title message on the next line\n`
)
: git.getLastCommitMessage(pullBranch)
}

// If user passes an empty title and description, --description will get merged into options.title
// Need to reference the original title not the potentially modified one
/*
* If user passes an empty title and description, --description will get merged into options.title
* Need to reference the original title not the potentially modified one
* Also check if user wants to user their editor to add a description
*/
if (useEditor && (userLeftMsgEmpty(options.title) || userLeftMsgEmpty(description))) {
description = openFileInEditor(
'temp-gh-pr-body.md',
Expand Down

0 comments on commit b445566

Please sign in to comment.