feat(cli): add destructive action warning and confirm before uninstall
Move warning box after component selection and add a confirmation prompt defaulting to No, so users see the irreversibility warning right before the point of no return. Non-interactive --yes mode skips both. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
54876a6af3
commit
75db9c2ec9
|
|
@ -95,6 +95,26 @@ module.exports = {
|
||||||
removeModules = selected.includes('modules');
|
removeModules = selected.includes('modules');
|
||||||
removeIdeConfigs = selected.includes('ide');
|
removeIdeConfigs = selected.includes('ide');
|
||||||
removeOutputFolder = selected.includes('output');
|
removeOutputFolder = selected.includes('output');
|
||||||
|
|
||||||
|
const red = (s) => `\u001B[31m${s}\u001B[0m`;
|
||||||
|
await prompts.note(
|
||||||
|
red('💀 This action is IRREVERSIBLE! Removed files cannot be recovered!') +
|
||||||
|
'\n' +
|
||||||
|
red('💀 IDE configurations and modules will need to be reinstalled.') +
|
||||||
|
'\n' +
|
||||||
|
red('💀 User artifacts are preserved unless explicitly selected.'),
|
||||||
|
'!! DESTRUCTIVE ACTION !!',
|
||||||
|
);
|
||||||
|
|
||||||
|
const confirmed = await prompts.confirm({
|
||||||
|
message: 'Proceed with uninstall?',
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
await prompts.outro('Uninstall cancelled.');
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phase 1: IDE integrations
|
// Phase 1: IDE integrations
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue