Displays default config after successful install.

This commit is contained in:
Ben 2025-02-24 10:36:27 +01:00
parent e26b65daf6
commit b9d6fd70b9
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
3 changed files with 11 additions and 7 deletions

View File

@ -75,9 +75,10 @@ export async function installCodex(config, showNavigationMenu) {
console.log(chalk.green('Codex is already installed. Version:'));
console.log(chalk.green(version));
await showNavigationMenu();
return false;
} else {
console.log(chalk.cyanBright('Codex is not installed, proceeding with installation...'));
await performInstall(config, showNavigationMenu);
return await performInstall(config);
}
}
@ -99,12 +100,11 @@ async function clearCodexExePathFromConfig(config) {
saveConfig(config);
}
async function performInstall(config, showNavigationMenu) {
async function performInstall(config) {
const agreed = await showPrivacyDisclaimer();
if (!agreed) {
console.log(showInfoMessage('You can find manual setup instructions at docs.codex.storage'));
process.exit(0);
return;
}
const installPath = getCodexBinPath();
@ -202,11 +202,11 @@ async function performInstall(config, showNavigationMenu) {
));
spinner.success();
await showNavigationMenu();
return true;
} catch (error) {
spinner.error();
console.log(showErrorMessage(`Failed to install Codex: ${error.message}`));
await showNavigationMenu();
return false;
}
}

View File

@ -64,7 +64,8 @@ export async function runCodex(config, showNavigationMenu) {
console.log(showInfoMessage(
`Data location: ${config.dataDir}\n` +
`Logs: ${logFilePath}`
`Logs: ${logFilePath}\n` +
`API port: ${config.ports.apiPort}`
));
const executable = config.codexExe;

View File

@ -99,7 +99,10 @@ export async function main() {
switch (choice.split('.')[0]) {
case '1':
await installCodex(config, showNavigationMenu);
const installed = await installCodex(config, showNavigationMenu);
if (installed) {
await showConfigMenu(config);
}
break;
case '2':
await showConfigMenu(config);