mirror of
https://github.com/codex-storage/cli.git
synced 2025-02-28 16:40:43 +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) {
|
async function saveCodexExePathToConfig(config, codexExePath) {
|
||||||
config.codexExe = path.join(process.env.LOCALAPPDATA, "Codex", "codex.exe");
|
config.codexExe = codexExePath;
|
||||||
if (!fs.existsSync(config.codexExe)) {
|
if (!fs.existsSync(config.codexExe)) {
|
||||||
console.log(showErrorMessage(`Codex executable not found in expected path: ${config.codexExe}`));
|
console.log(showErrorMessage(`Codex executable not found in expected path: ${config.codexExe}`));
|
||||||
throw new Error("Exe not found");
|
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('curl -LO --ssl-no-revoke https://get.codex.storage/install.cmd');
|
||||||
await runCommand(`"${process.cwd()}\\install.cmd"`);
|
await runCommand(`"${process.cwd()}\\install.cmd"`);
|
||||||
|
|
||||||
await saveCodexExePathToConfig(config);
|
await saveCodexExePathToConfig(config, path.join(process.env.LOCALAPPDATA, "Codex", "codex.exe"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await runCommand('del /f install.cmd');
|
await runCommand('del /f install.cmd');
|
||||||
@ -158,6 +158,8 @@ export async function installCodex(config, showNavigationMenu) {
|
|||||||
} else {
|
} else {
|
||||||
await runCommand('timeout 120 bash install.sh');
|
await runCommand('timeout 120 bash install.sh');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await saveCodexExePathToConfig(config, path.join(process.env.LOCALAPPDATA, "Codex", "codex"));
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message.includes('ECONNREFUSED') || error.message.includes('ETIMEDOUT')) {
|
if (error.message.includes('ECONNREFUSED') || error.message.includes('ETIMEDOUT')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user