Skip to content

Commit 59e4cc7

Browse files
Brian MadisonBrian Madison
authored andcommitted
minor code cleanup
1 parent c24821b commit 59e4cc7

File tree

2 files changed

+4
-168
lines changed

2 files changed

+4
-168
lines changed

tools/cli/installers/lib/core/installer.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class Installer {
5050
return { bmadDir: path.join(projectDir, '_bmad'), hasLegacyCfg: false };
5151
}
5252

53-
// V6+ strategy: Look for ANY directory with _config/manifest.yaml or legacy _cfg/manifest.yaml
5453
let bmadDir = null;
5554
let hasLegacyCfg = false;
5655

@@ -76,7 +75,7 @@ class Installer {
7675
}
7776
}
7877
} catch {
79-
// Ignore errors, fall through to default
78+
console.log(chalk.red('Error reading project directory for BMAD installation detection'));
8079
}
8180

8281
// If we found a bmad directory (with or without legacy _cfg)
@@ -321,6 +320,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
321320

322321
for (const ide of newlySelectedIdes) {
323322
// List of IDEs that have interactive prompts
323+
//TODO: Why is this here, hardcoding this list here is bad, fix me!
324324
const needsPrompts = ['claude-code', 'github-copilot', 'roo', 'cline', 'auggie', 'codex', 'qwen', 'gemini', 'rovo-dev'].includes(
325325
ide,
326326
);
@@ -344,7 +344,6 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
344344
} else if (ideModule.default) {
345345
SetupClass = ideModule.default;
346346
} else {
347-
// Skip if no setup class found
348347
continue;
349348
}
350349

@@ -398,10 +397,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
398397
const hasCoreConfig = config.coreConfig && Object.keys(config.coreConfig).length > 0;
399398

400399
// Only display logo if core config wasn't already collected (meaning we're not continuing from UI)
401-
if (hasCoreConfig) {
402-
// Core config was already collected in UI, show smooth continuation
403-
// Don't clear screen, just continue flow
404-
} else {
400+
if (!hasCoreConfig) {
405401
// Display BMAD logo
406402
CLIUtils.displayLogo();
407403

@@ -797,7 +793,6 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
797793
config.skipIde = toolSelection.skipIde;
798794
const ideConfigurations = toolSelection.configurations;
799795

800-
// Check if spinner is already running (e.g., from folder name change scenario)
801796
if (spinner.isSpinning) {
802797
spinner.text = 'Continuing installation...';
803798
} else {
@@ -828,7 +823,6 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
828823
spinner.succeed('Custom modules cached');
829824
}
830825

831-
// Get project root
832826
const projectRoot = getProjectRoot();
833827

834828
// Step 1: Install core module first (if requested)
@@ -985,7 +979,6 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
985979
this.moduleManager.setCustomModulePaths(customModulePaths);
986980
}
987981

988-
// Get collected config for this custom module (from module.yaml prompts)
989982
const collectedModuleConfig = moduleConfigs[moduleName] || {};
990983

991984
// Use ModuleManager to install the custom module
@@ -1002,8 +995,6 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
1002995
},
1003996
);
1004997

1005-
// ModuleManager installs directly to the target directory, no need to move files
1006-
1007998
// Create module config (include collected config from module.yaml prompts)
1008999
await this.generateModuleConfigs(bmadDir, {
10091000
[moduleName]: { ...config.coreConfig, ...customInfo.config, ...collectedModuleConfig },
@@ -1558,14 +1549,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
15581549
async installCoreWithDependencies(bmadDir, coreFiles) {
15591550
const sourcePath = getModulePath('core');
15601551
const targetPath = path.join(bmadDir, 'core');
1561-
1562-
// Install full core
15631552
await this.installCore(bmadDir);
1564-
1565-
// If there are specific dependency files, ensure they're included
1566-
if (coreFiles) {
1567-
// Already handled by installCore for core module
1568-
}
15691553
}
15701554

15711555
/**

tools/cli/lib/ui.js

Lines changed: 1 addition & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ const { CustomHandler } = require('../installers/lib/custom/handler');
1010
* UI utilities for the installer
1111
*/
1212
class UI {
13-
constructor() {}
14-
1513
/**
1614
* Prompt for installation configuration
1715
* @returns {Object} Installation configuration
@@ -161,14 +159,8 @@ class UI {
161159
}
162160
}
163161

164-
// Always ask for custom content, but we'll handle it differently for new installs
165162
let customContentConfig = { hasCustomContent: false };
166-
if (hasExistingInstall) {
167-
// Existing installation - prompt to add/update custom content
168-
customContentConfig = await this.promptCustomContentForExisting();
169-
} else {
170-
// New installation - we'll prompt after creating the directory structure
171-
// For now, set a flag to indicate we should ask later
163+
if (!hasExistingInstall) {
172164
customContentConfig._shouldAsk = true;
173165
}
174166

@@ -1140,146 +1132,6 @@ class UI {
11401132
return existingInstall.ides || [];
11411133
}
11421134

1143-
/**
1144-
* Prompt for custom content for existing installations
1145-
* @returns {Object} Custom content configuration
1146-
*/
1147-
async promptCustomContentForExisting() {
1148-
try {
1149-
// Skip custom content installation - always return false
1150-
return { hasCustomContent: false };
1151-
1152-
// TODO: Custom content installation temporarily disabled
1153-
// CLIUtils.displaySection('Custom Content', 'Add new custom agents, workflows, or modules to your installation');
1154-
1155-
// const { hasCustomContent } = await inquirer.prompt([
1156-
// {
1157-
// type: 'list',
1158-
// name: 'hasCustomContent',
1159-
// message: 'Do you want to add or update custom content?',
1160-
// choices: [
1161-
// {
1162-
// name: 'No, continue with current installation only',
1163-
// value: false,
1164-
// },
1165-
// {
1166-
// name: 'Yes, I have custom content to add or update',
1167-
// value: true,
1168-
// },
1169-
// ],
1170-
// default: false,
1171-
// },
1172-
// ]);
1173-
1174-
// if (!hasCustomContent) {
1175-
// return { hasCustomContent: false };
1176-
// }
1177-
1178-
// TODO: Custom content installation temporarily disabled
1179-
// // Get directory path
1180-
// const { customPath } = await inquirer.prompt([
1181-
// {
1182-
// type: 'input',
1183-
// name: 'customPath',
1184-
// message: 'Enter directory to search for custom content (will scan subfolders):',
1185-
// default: process.cwd(),
1186-
// validate: async (input) => {
1187-
// if (!input || input.trim() === '') {
1188-
// return 'Please enter a directory path';
1189-
// }
1190-
1191-
// // Normalize and check if path exists
1192-
// const expandedPath = CLIUtils.expandPath(input.trim());
1193-
// const pathExists = await fs.pathExists(expandedPath);
1194-
// if (!pathExists) {
1195-
// return 'Directory does not exist';
1196-
// }
1197-
1198-
// // Check if it's actually a directory
1199-
// const stats = await fs.stat(expandedPath);
1200-
// if (!stats.isDirectory()) {
1201-
// return 'Path must be a directory';
1202-
// }
1203-
1204-
// return true;
1205-
// },
1206-
// transformer: (input) => {
1207-
// return CLIUtils.expandPath(input);
1208-
// },
1209-
// },
1210-
// ]);
1211-
1212-
// const resolvedPath = CLIUtils.expandPath(customPath);
1213-
1214-
// // Find custom content
1215-
// const customHandler = new CustomHandler();
1216-
// const customFiles = await customHandler.findCustomContent(resolvedPath);
1217-
1218-
// if (customFiles.length === 0) {
1219-
// console.log(chalk.yellow(`\nNo custom content found in ${resolvedPath}`));
1220-
1221-
// const { tryDifferent } = await inquirer.prompt([
1222-
// {
1223-
// type: 'confirm',
1224-
// name: 'tryDifferent',
1225-
// message: 'Try a different directory?',
1226-
// default: true,
1227-
// },
1228-
// ]);
1229-
1230-
// if (tryDifferent) {
1231-
// return await this.promptCustomContentForExisting();
1232-
// }
1233-
1234-
// return { hasCustomContent: false };
1235-
// }
1236-
1237-
// // Display found items
1238-
// console.log(chalk.cyan(`\nFound ${customFiles.length} custom content file(s):`));
1239-
// const customContentItems = [];
1240-
1241-
// for (const customFile of customFiles) {
1242-
// const customInfo = await customHandler.getCustomInfo(customFile);
1243-
// if (customInfo) {
1244-
// customContentItems.push({
1245-
// name: `${chalk.cyan('✓')} ${customInfo.name} ${chalk.gray(`(${customInfo.relativePath})`)}`,
1246-
// value: `__CUSTOM_CONTENT__${customFile}`,
1247-
// checked: true,
1248-
// });
1249-
// }
1250-
// }
1251-
1252-
// // Add option to keep existing custom content
1253-
// console.log(chalk.yellow('\nExisting custom modules will be preserved unless you remove them'));
1254-
1255-
// const { selectedFiles } = await inquirer.prompt([
1256-
// {
1257-
// type: 'checkbox',
1258-
// name: 'selectedFiles',
1259-
// message: 'Select custom content to add:',
1260-
// choices: customContentItems,
1261-
// pageSize: 15,
1262-
// validate: (answer) => {
1263-
// if (answer.length === 0) {
1264-
// return 'You must select at least one item';
1265-
// }
1266-
// return true;
1267-
// },
1268-
// },
1269-
// ]);
1270-
1271-
// return {
1272-
// hasCustomContent: true,
1273-
// customPath: resolvedPath,
1274-
// selected: true,
1275-
// selectedFiles: selectedFiles,
1276-
// };
1277-
} catch (error) {
1278-
console.error(chalk.red('Error configuring custom content:'), error);
1279-
return { hasCustomContent: false };
1280-
}
1281-
}
1282-
12831135
/**
12841136
* Prompt user for custom content source location
12851137
* @returns {Object} Custom content configuration

0 commit comments

Comments
 (0)