fix: propagate skipPrompts flag to IDE collectConfiguration calls
The --yes flag (skipPrompts) was not being passed through to IDE handler collectConfiguration() calls, causing the Codex installer to hang on its interactive prompt in non-interactive mode (CI/CD, --yes flag). - Add skipPrompts parameter to collectToolConfigurations() and forward it to handler.collectConfiguration() options - Add early return in CodexSetup.collectConfiguration() when skipPrompts is true, defaulting to global install location - Guard IDE removal confirmation prompt with skipPrompts check, defaulting to preserve existing configs (consistent with prompt default: false) Fixes #1610 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
58f34c2c92
commit
f967fdde89
|
|
@ -109,9 +109,17 @@ class Installer {
|
|||
* @param {boolean} isFullReinstall - Whether this is a full reinstall
|
||||
* @param {Array} previousIdes - Previously configured IDEs (for reinstalls)
|
||||
* @param {Array} preSelectedIdes - Pre-selected IDEs from early prompt (optional)
|
||||
* @param {boolean} skipPrompts - Skip prompts and use defaults (for --yes flag)
|
||||
* @returns {Object} Tool/IDE selection and configurations
|
||||
*/
|
||||
async collectToolConfigurations(projectDir, selectedModules, isFullReinstall = false, previousIdes = [], preSelectedIdes = null) {
|
||||
async collectToolConfigurations(
|
||||
projectDir,
|
||||
selectedModules,
|
||||
isFullReinstall = false,
|
||||
previousIdes = [],
|
||||
preSelectedIdes = null,
|
||||
skipPrompts = false,
|
||||
) {
|
||||
// Use pre-selected IDEs if provided, otherwise prompt
|
||||
let toolConfig;
|
||||
if (preSelectedIdes === null) {
|
||||
|
|
@ -182,6 +190,7 @@ class Installer {
|
|||
selectedModules: selectedModules || [],
|
||||
projectDir,
|
||||
bmadDir,
|
||||
skipPrompts,
|
||||
});
|
||||
} else {
|
||||
// Config-driven IDEs don't need configuration - mark as ready
|
||||
|
|
@ -684,6 +693,7 @@ class Installer {
|
|||
config._isFullReinstall || false,
|
||||
config._previouslyConfiguredIdes || [],
|
||||
preSelectedIdes,
|
||||
config.skipPrompts || false,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -709,7 +719,10 @@ class Installer {
|
|||
await prompts.log.error(` - ${ide}`);
|
||||
}
|
||||
|
||||
const confirmRemoval = await prompts.confirm({
|
||||
// In non-interactive mode, preserve existing configs (matches prompt default: false)
|
||||
const confirmRemoval = config.skipPrompts
|
||||
? false
|
||||
: await prompts.confirm({
|
||||
message: `Remove BMAD configuration for ${idesToRemove.length} IDE(s)?`,
|
||||
default: false,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ class CodexSetup extends BaseIdeSetup {
|
|||
* @returns {Object} Collected configuration
|
||||
*/
|
||||
async collectConfiguration(options = {}) {
|
||||
// Non-interactive mode: use default (global)
|
||||
if (options.skipPrompts) {
|
||||
return { installLocation: 'global' };
|
||||
}
|
||||
|
||||
let confirmed = false;
|
||||
let installLocation = 'global';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue