mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-02 21:50:52 +00:00
Add tests for core/utils/editor (#851)
This commit is contained in:
parent
241c404573
commit
394312b9c2
2 changed files with 126 additions and 9 deletions
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue