diff options
| author | Eddie Santos <[email protected]> | 2025-06-08 12:42:42 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-08 19:42:42 +0000 |
| commit | 394312b9c2f6006293b344a3c2b81da17332a2d5 (patch) | |
| tree | f34550a2adc6b755b9d59519894b06c930644233 /packages/core/src/utils/editor.ts | |
| parent | 241c404573a8dd8c032dde5478a9bec95dd83a19 (diff) | |
Add tests for `core/utils/editor` (#851)
Diffstat (limited to 'packages/core/src/utils/editor.ts')
| -rw-r--r-- | packages/core/src/utils/editor.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/core/src/utils/editor.ts b/packages/core/src/utils/editor.ts index 6f65d8da..447aa0d2 100644 --- a/packages/core/src/utils/editor.ts +++ b/packages/core/src/utils/editor.ts @@ -13,16 +13,16 @@ interface DiffCommand { args: string[]; } -export function checkHasEditor(editor: EditorType): boolean { - const commandExists = (cmd: string): boolean => { - try { - execSync(`which ${cmd}`, { stdio: 'ignore' }); - return true; - } catch { - return false; - } - }; +function commandExists(cmd: string): boolean { + try { + execSync(`which ${cmd}`, { stdio: 'ignore' }); + return true; + } catch { + return false; + } +} +export function checkHasEditor(editor: EditorType): boolean { if (editor === 'vscode') { return commandExists('code'); } else if (editor === 'vim') { |
