mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 19:14:33 -07:00
Add tests for core/utils/editor (#851)
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user