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 {boolean} isFullReinstall - Whether this is a full reinstall
|
||||||
* @param {Array} previousIdes - Previously configured IDEs (for reinstalls)
|
* @param {Array} previousIdes - Previously configured IDEs (for reinstalls)
|
||||||
* @param {Array} preSelectedIdes - Pre-selected IDEs from early prompt (optional)
|
* @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
|
* @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
|
// Use pre-selected IDEs if provided, otherwise prompt
|
||||||
let toolConfig;
|
let toolConfig;
|
||||||
if (preSelectedIdes === null) {
|
if (preSelectedIdes === null) {
|
||||||
|
|
@ -182,6 +190,7 @@ class Installer {
|
||||||
selectedModules: selectedModules || [],
|
selectedModules: selectedModules || [],
|
||||||
projectDir,
|
projectDir,
|
||||||
bmadDir,
|
bmadDir,
|
||||||
|
skipPrompts,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Config-driven IDEs don't need configuration - mark as ready
|
// Config-driven IDEs don't need configuration - mark as ready
|
||||||
|
|
@ -684,6 +693,7 @@ class Installer {
|
||||||
config._isFullReinstall || false,
|
config._isFullReinstall || false,
|
||||||
config._previouslyConfiguredIdes || [],
|
config._previouslyConfiguredIdes || [],
|
||||||
preSelectedIdes,
|
preSelectedIdes,
|
||||||
|
config.skipPrompts || false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -709,10 +719,13 @@ class Installer {
|
||||||
await prompts.log.error(` - ${ide}`);
|
await prompts.log.error(` - ${ide}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmRemoval = await prompts.confirm({
|
// In non-interactive mode, preserve existing configs (matches prompt default: false)
|
||||||
message: `Remove BMAD configuration for ${idesToRemove.length} IDE(s)?`,
|
const confirmRemoval = config.skipPrompts
|
||||||
default: false,
|
? false
|
||||||
});
|
: await prompts.confirm({
|
||||||
|
message: `Remove BMAD configuration for ${idesToRemove.length} IDE(s)?`,
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
|
||||||
if (confirmRemoval) {
|
if (confirmRemoval) {
|
||||||
await this.ideManager.ensureInitialized();
|
await this.ideManager.ensureInitialized();
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ class CodexSetup extends BaseIdeSetup {
|
||||||
* @returns {Object} Collected configuration
|
* @returns {Object} Collected configuration
|
||||||
*/
|
*/
|
||||||
async collectConfiguration(options = {}) {
|
async collectConfiguration(options = {}) {
|
||||||
|
// Non-interactive mode: use default (global)
|
||||||
|
if (options.skipPrompts) {
|
||||||
|
return { installLocation: 'global' };
|
||||||
|
}
|
||||||
|
|
||||||
let confirmed = false;
|
let confirmed = false;
|
||||||
let installLocation = 'global';
|
let installLocation = 'global';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue