fix: prevent spinner from hiding confirmation prompt during upgrade
Fixes #907 When quickUpdate() called install(), two spinners ran simultaneously. The quickUpdate spinner continued running while install() stopped its own spinner to show prompts, causing the confirmation prompt to be hidden behind the spinner animation. Now quickUpdate() always stops its spinner before calling install(), ensuring only one spinner is active and all prompts are visible.
This commit is contained in:
parent
05ccd1904c
commit
d05f6ee420
|
|
@ -1763,10 +1763,11 @@ class Installer {
|
||||||
const newBmadFolderName = this.configCollector.collectedConfig.core?.bmad_folder || existingBmadFolderName;
|
const newBmadFolderName = this.configCollector.collectedConfig.core?.bmad_folder || existingBmadFolderName;
|
||||||
|
|
||||||
if (existingBmadFolderName === newBmadFolderName) {
|
if (existingBmadFolderName === newBmadFolderName) {
|
||||||
// Normal quick update - start the spinner
|
// Normal quick update - stop spinner before calling install()
|
||||||
spinner.start('Updating BMAD installation...');
|
// install() will manage its own spinner
|
||||||
|
spinner.stop();
|
||||||
} else {
|
} else {
|
||||||
// Folder name has changed - stop spinner and let install() handle it
|
// Folder name has changed - notify user that install() will handle migration
|
||||||
spinner.stop();
|
spinner.stop();
|
||||||
console.log(chalk.yellow(`\n⚠️ Folder name will change: ${existingBmadFolderName} → ${newBmadFolderName}`));
|
console.log(chalk.yellow(`\n⚠️ Folder name will change: ${existingBmadFolderName} → ${newBmadFolderName}`));
|
||||||
console.log(chalk.yellow('The installer will handle the folder migration.\n'));
|
console.log(chalk.yellow('The installer will handle the folder migration.\n'));
|
||||||
|
|
@ -1786,14 +1787,12 @@ class Installer {
|
||||||
_savedIdeConfigs: savedIdeConfigs, // Pass saved IDE configs to installer
|
_savedIdeConfigs: savedIdeConfigs, // Pass saved IDE configs to installer
|
||||||
};
|
};
|
||||||
|
|
||||||
// Call the standard install method
|
// Call the standard install method (it will manage its own spinner)
|
||||||
const result = await this.install(installConfig);
|
const result = await this.install(installConfig);
|
||||||
|
|
||||||
// Only succeed the spinner if it's still spinning
|
// install() handles its own spinner, so no need to check if our spinner is spinning
|
||||||
// (install method might have stopped it if folder name changed)
|
// Just show completion message
|
||||||
if (spinner.isSpinning) {
|
console.log(chalk.green('✓ Quick update complete!'));
|
||||||
spinner.succeed('Quick update complete!');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
|
@ -1804,7 +1803,12 @@ class Installer {
|
||||||
ides: configuredIdes,
|
ides: configuredIdes,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
spinner.fail('Quick update failed');
|
// Spinner is already stopped, just show error
|
||||||
|
if (spinner.isSpinning) {
|
||||||
|
spinner.fail('Quick update failed');
|
||||||
|
} else {
|
||||||
|
console.error(chalk.red('✗ Quick update failed'));
|
||||||
|
}
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue