From b445566a6b84bce50c4f0839723ba65594b5bd33 Mon Sep 17 00:00:00 2001 From: protoEvangelion Date: Wed, 29 Jan 2020 09:16:35 -0800 Subject: [PATCH] fix(pull-request): release 'If use_editor setting is false don't open the editor' --- src/cmds/pull-request/submit.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/cmds/pull-request/submit.ts b/src/cmds/pull-request/submit.ts index 2e32f1d5..f1969042 100644 --- a/src/cmds/pull-request/submit.ts +++ b/src/cmds/pull-request/submit.ts @@ -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',