fix: use defaults for new config fields during quick update

When quick update encounters new config fields (e.g., from a newly
supported community module), use schema defaults silently instead of
prompting the user. Quick update should be non-interactive.
This commit is contained in:
Brian Madison 2026-04-08 00:38:34 -05:00
parent bbcc6a8961
commit 66914df2c7
1 changed files with 7 additions and 1 deletions

View File

@ -1147,7 +1147,13 @@ class OfficialModules {
// Collect all answers (static + prompted)
let allAnswers = { ...staticAnswers };
if (questions.length > 0) {
if (questions.length > 0 && silentMode) {
// In silent mode (quick update), use defaults for new fields instead of prompting
for (const q of questions) {
allAnswers[q.name] = typeof q.default === 'function' ? q.default({}) : q.default;
}
await prompts.log.message(` \u2713 ${moduleName.toUpperCase()} module configured with defaults`);
} else if (questions.length > 0) {
// Only show header if we actually have questions
await CLIUtils.displayModuleConfigHeader(moduleName, moduleConfig.header, moduleConfig.subheader);
await prompts.log.message('');