Merge 0484003a45a35664f7412efb1028d8697696c8cb into a67cf3031f7a702ea2ce0f702bd63a0471d83693

This commit is contained in:
Dmitriy Ryajov 2025-02-25 14:49:17 -06:00 committed by GitHub
commit fe73104e1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 20 deletions

View File

@ -163,7 +163,7 @@ async function performInstall(config) {
await runCommand('curl -LO --ssl-no-revoke https://get.codex.storage/install.cmd');
await runCommand(`set "INSTALL_DIR=${installPath}" && "${process.cwd()}\\install.cmd"`);
await saveCodexExePath(config, path.join(installPath, "codex.exe"));
try {
@ -190,24 +190,10 @@ async function performInstall(config) {
const downloadCommand = 'curl -# --connect-timeout 10 --max-time 60 -L https://get.codex.storage/install.sh -o install.sh && chmod +x install.sh';
await runCommand(downloadCommand);
if (platform === 'darwin') {
const timeoutCommand = `perl -e '
eval {
local $SIG{ALRM} = sub { die "timeout\\n" };
alarm(120);
system("INSTALL_DIR=\\"${installPath}\\" bash install.sh");
alarm(0);
};
die if $@;
'`;
await runCommand(timeoutCommand);
} else {
await runCommand(`INSTALL_DIR="${installPath}" timeout 120 bash install.sh`);
}
await runCommand(`INSTALL_DIR="${installPath}" timeout 120 bash install.sh`);
await saveCodexExePath(config, path.join(installPath, "codex"));
} catch (error) {
if (error.message.includes('ECONNREFUSED') || error.message.includes('ETIMEDOUT')) {
throw new Error('Installation failed. Please check your internet connection and try again.');
@ -222,7 +208,7 @@ async function performInstall(config) {
await runCommand('rm -f install.sh').catch(() => {});
}
}
try {
const version = await getCodexVersion(config);
console.log(chalk.green(version));
@ -251,7 +237,7 @@ async function performInstall(config) {
console.log(showInfoMessage(
"Please review the configuration before starting Codex."
));
spinner.success();
return true;
} catch (error) {

View File

@ -11,4 +11,4 @@ export async function runCommand(command) {
console.error('Error:', error.message);
throw error;
}
}
}