Fix bug
This commit is contained in:
parent
7db4b9834e
commit
307be3b63d
18 changed files with 406 additions and 179 deletions
|
|
@ -41,15 +41,23 @@ const deleteNestedSection = (obj, dottedKey) => {
|
|||
delete cur[keys[keys.length - 1]];
|
||||
};
|
||||
|
||||
// Check if codex CLI is installed
|
||||
// Check if codex CLI is installed (via which/where or config file exists)
|
||||
const checkCodexInstalled = async () => {
|
||||
try {
|
||||
const isWindows = os.platform() === "win32";
|
||||
const command = isWindows ? "where codex" : "command -v codex";
|
||||
await execAsync(command, { windowsHide: true });
|
||||
const command = isWindows ? "where codex" : "which codex";
|
||||
const env = isWindows
|
||||
? { ...process.env, PATH: `${process.env.APPDATA}\\npm;${process.env.PATH}` }
|
||||
: process.env;
|
||||
await execAsync(command, { windowsHide: true, env });
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
try {
|
||||
await fs.access(getCodexConfigPath());
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue