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

Commit 81624e7

Browse files
Julien CastelainRyan Garant
authored andcommitted
fix: apply suggested pr review changes
1 parent 192e142 commit 81624e7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/utils.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ export function openFileInEditor(fileName: string, msg: string): string {
7777

7878
writeFileSync(filePath, msg)
7979

80-
const editor = process.env.EDITOR
81-
? process.env.EDITOR
82-
: process.env.VISUAL
83-
? process.env.VISUAL
84-
: spawnSync('git', ['config', '--global', 'core.editor']).stdout
80+
const editor =
81+
process.env.EDITOR ||
82+
process.env.VISUAL ||
83+
spawnSync('git', ['config', '--global', 'core.editor']).stdout
8584

8685
if (!editor) {
87-
throw new Error('Could not determine which editor to use')
86+
return 'Could not determine which editor to use'
8887
}
8988

9089
execSyncInteractiveStream(`${editor} "${filePath}"`)

0 commit comments

Comments
 (0)