Compare commits

...

2 Commits

Author SHA1 Message Date
Nikolas Hor 07ef1122a3
Merge 6848e3ae54 into f3f606a9ce 2026-03-17 22:35:19 -03:00
Nikolas de Hor 6848e3ae54 fix: ensure --yes flag assigns defaults for fields without values
When skipPrompts is true, config fields without a default value
were silently skipped, leaving them undefined in the collected
config. This caused downstream code to prompt the user or fail
when encountering missing config values.

Now assigns empty string as fallback for fields without defaults
when --yes flag is active, ensuring fully non-interactive install.

Fixes #1803
2026-03-11 21:25:40 -03:00
1 changed files with 5 additions and 4 deletions

View File

@ -735,12 +735,13 @@ class ConfigCollector {
// Skip prompts mode: use all defaults without asking
if (this.skipPrompts) {
await prompts.log.info(`Using default configuration for ${moduleDisplayName}`);
// Use defaults for all questions
// Use defaults for all questions; use empty string for fields without defaults
for (const question of questions) {
const hasDefault = question.default !== undefined && question.default !== null && question.default !== '';
if (hasDefault && typeof question.default !== 'function') {
allAnswers[question.name] = question.default;
if (typeof question.default === 'function') {
continue;
}
const hasDefault = question.default !== undefined && question.default !== null && question.default !== '';
allAnswers[question.name] = hasDefault ? question.default : '';
}
} else {
if (!this._silentConfig) await prompts.log.step(`Configuring ${moduleDisplayName}`);