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

Commit

Permalink
fix: apply suggested pr review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Castelain authored and Ryan Garant committed Nov 25, 2019
1 parent 192e142 commit 81624e7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,13 @@ export function openFileInEditor(fileName: string, msg: string): string {

writeFileSync(filePath, msg)

const editor = process.env.EDITOR
? process.env.EDITOR
: process.env.VISUAL
? process.env.VISUAL
: spawnSync('git', ['config', '--global', 'core.editor']).stdout
const editor =
process.env.EDITOR ||
process.env.VISUAL ||
spawnSync('git', ['config', '--global', 'core.editor']).stdout

if (!editor) {
throw new Error('Could not determine which editor to use')
return 'Could not determine which editor to use'
}

execSyncInteractiveStream(`${editor} "${filePath}"`)
Expand Down

0 comments on commit 81624e7

Please sign in to comment.