fix: address review feedback on choices.find() and comment clarity
This commit is contained in:
parent
defab55922
commit
dff2cc9cb5
|
|
@ -94,7 +94,7 @@ class UI {
|
||||||
}
|
}
|
||||||
const hasQuickUpdate = choices.some((c) => c.value === 'quick-update');
|
const hasQuickUpdate = choices.some((c) => c.value === 'quick-update');
|
||||||
const needsFullUpdate = !!options.customSource;
|
const needsFullUpdate = !!options.customSource;
|
||||||
actionType = hasQuickUpdate && !needsFullUpdate ? 'quick-update' : choices.find((c) => c.value === 'update') || choices[0].value;
|
actionType = hasQuickUpdate && !needsFullUpdate ? 'quick-update' : (choices.find((c) => c.value === 'update') || choices[0]).value;
|
||||||
await prompts.log.info(`Non-interactive mode (--yes): defaulting to ${actionType}`);
|
await prompts.log.info(`Non-interactive mode (--yes): defaulting to ${actionType}`);
|
||||||
} else {
|
} else {
|
||||||
actionType = await prompts.select({
|
actionType = await prompts.select({
|
||||||
|
|
@ -132,7 +132,7 @@ class UI {
|
||||||
await prompts.log.info(`Using modules from command-line: ${selectedModules.join(', ')}`);
|
await prompts.log.info(`Using modules from command-line: ${selectedModules.join(', ')}`);
|
||||||
} else if (options.customSource && !options.yes) {
|
} else if (options.customSource && !options.yes) {
|
||||||
// Custom source without --modules or --yes: start with empty list
|
// Custom source without --modules or --yes: start with empty list
|
||||||
// (user will be prompted to select modules interactively; core added below).
|
// (only custom source modules + core will be installed).
|
||||||
// When --yes is also set, fall through to the --yes branch so all
|
// When --yes is also set, fall through to the --yes branch so all
|
||||||
// installed modules are included alongside the custom source modules.
|
// installed modules are included alongside the custom source modules.
|
||||||
selectedModules = [];
|
selectedModules = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue