mirror of
https://github.com/codex-storage/cli.git
synced 2025-02-28 08:30:41 +00:00
attempt to fix install path for non-windows
This commit is contained in:
parent
771888f427
commit
27bd79d4b1
@ -80,8 +80,8 @@ export async function checkCodexInstallation(config, showNavigationMenu) {
|
||||
}
|
||||
}
|
||||
|
||||
async function saveCodexExePathToConfig(config) {
|
||||
config.codexExe = path.join(process.env.LOCALAPPDATA, "Codex", "codex.exe");
|
||||
async function saveCodexExePathToConfig(config, codexExePath) {
|
||||
config.codexExe = codexExePath;
|
||||
if (!fs.existsSync(config.codexExe)) {
|
||||
console.log(showErrorMessage(`Codex executable not found in expected path: ${config.codexExe}`));
|
||||
throw new Error("Exe not found");
|
||||
@ -116,7 +116,7 @@ export async function installCodex(config, showNavigationMenu) {
|
||||
await runCommand('curl -LO --ssl-no-revoke https://get.codex.storage/install.cmd');
|
||||
await runCommand(`"${process.cwd()}\\install.cmd"`);
|
||||
|
||||
await saveCodexExePathToConfig(config);
|
||||
await saveCodexExePathToConfig(config, path.join(process.env.LOCALAPPDATA, "Codex", "codex.exe"));
|
||||
|
||||
try {
|
||||
await runCommand('del /f install.cmd');
|
||||
@ -158,6 +158,8 @@ export async function installCodex(config, showNavigationMenu) {
|
||||
} else {
|
||||
await runCommand('timeout 120 bash install.sh');
|
||||
}
|
||||
|
||||
await saveCodexExePathToConfig(config, path.join(process.env.LOCALAPPDATA, "Codex", "codex"));
|
||||
|
||||
} catch (error) {
|
||||
if (error.message.includes('ECONNREFUSED') || error.message.includes('ETIMEDOUT')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user