fix: installer upgrade path fixed
This commit is contained in:
@@ -425,7 +425,10 @@ class Installer {
|
|||||||
console.log(chalk.cyan("\n📦 Starting v3 to v4 upgrade process..."));
|
console.log(chalk.cyan("\n📦 Starting v3 to v4 upgrade process..."));
|
||||||
const V3ToV4Upgrader = require("../../upgraders/v3-to-v4-upgrader");
|
const V3ToV4Upgrader = require("../../upgraders/v3-to-v4-upgrader");
|
||||||
const upgrader = new V3ToV4Upgrader();
|
const upgrader = new V3ToV4Upgrader();
|
||||||
return await upgrader.upgrade({ projectPath: installDir });
|
return await upgrader.upgrade({
|
||||||
|
projectPath: installDir,
|
||||||
|
ides: config.ides || [] // Pass IDE selections from initial config
|
||||||
|
});
|
||||||
}
|
}
|
||||||
case "alongside":
|
case "alongside":
|
||||||
return await this.performFreshInstall(config, installDir, spinner);
|
return await this.performFreshInstall(config, installDir, spinner);
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class V3ToV4Upgrader {
|
|||||||
|
|
||||||
// 8. Setup IDE
|
// 8. Setup IDE
|
||||||
if (!options.dryRun) {
|
if (!options.dryRun) {
|
||||||
await this.setupIDE(projectPath);
|
await this.setupIDE(projectPath, options.ides);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9. Show completion report
|
// 9. Show completion report
|
||||||
@@ -379,8 +379,8 @@ class V3ToV4Upgrader {
|
|||||||
const spinner = ora("Installing V4 structure...").start();
|
const spinner = ora("Installing V4 structure...").start();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the source .bmad-core directory
|
// Get the source bmad-core directory (without dot prefix)
|
||||||
const sourcePath = path.join(__dirname, "..", "..", ".bmad-core");
|
const sourcePath = path.join(__dirname, "..", "..", "bmad-core");
|
||||||
const destPath = path.join(projectPath, ".bmad-core");
|
const destPath = path.join(projectPath, ".bmad-core");
|
||||||
|
|
||||||
// Copy .bmad-core
|
// Copy .bmad-core
|
||||||
@@ -545,47 +545,37 @@ class V3ToV4Upgrader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async setupIDE(projectPath) {
|
async setupIDE(projectPath, selectedIdes) {
|
||||||
const { ide } = await inquirer.prompt([
|
// Use the IDE selections passed from the installer
|
||||||
{
|
if (!selectedIdes || selectedIdes.length === 0) {
|
||||||
type: "list",
|
console.log(chalk.dim("No IDE setup requested - skipping"));
|
||||||
name: "ide",
|
return;
|
||||||
message: "Which IDE are you using?",
|
}
|
||||||
choices: [
|
|
||||||
{ name: "Cursor", value: "cursor" },
|
|
||||||
{ name: "Claude Code", value: "claude-code" },
|
|
||||||
{ name: "Windsurf", value: "windsurf" },
|
|
||||||
{ name: "Roo Code", value: "roo" },
|
|
||||||
{ name: "VS Code", value: "skip" },
|
|
||||||
{ name: "Other/Skip", value: "skip" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const selectedIde = ide === "skip" ? null : ide;
|
const ideSetup = require("../installer/lib/ide-setup");
|
||||||
|
const spinner = ora("Setting up IDE rules for all agents...").start();
|
||||||
|
|
||||||
if (selectedIde) {
|
try {
|
||||||
const ideSetup = require("../installer/lib/ide-setup");
|
const ideMessages = {
|
||||||
const spinner = ora("Setting up IDE rules for all agents...").start();
|
cursor: "Rules created in .cursor/rules/",
|
||||||
|
"claude-code": "Commands created in .claude/commands/",
|
||||||
|
windsurf: "Rules created in .windsurf/rules/",
|
||||||
|
roo: "Custom modes created in .roomodes",
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
// Setup each selected IDE
|
||||||
await ideSetup.setup(selectedIde, projectPath);
|
for (const ide of selectedIdes) {
|
||||||
spinner.succeed("IDE setup complete!");
|
spinner.text = `Setting up ${ide}...`;
|
||||||
|
await ideSetup.setup(ide, projectPath);
|
||||||
const ideMessages = {
|
console.log(chalk.green(`\n✓ ${ideMessages[ide]}`));
|
||||||
cursor: "Rules created in .cursor/rules/",
|
|
||||||
"claude-code": "Commands created in .claude/commands/",
|
|
||||||
windsurf: "Rules created in .windsurf/rules/",
|
|
||||||
roo: "Custom modes created in .roomodes",
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(chalk.green(`- ${ideMessages[selectedIde]}`));
|
|
||||||
} catch (error) {
|
|
||||||
spinner.fail("IDE setup failed");
|
|
||||||
console.error(
|
|
||||||
chalk.yellow("IDE setup failed, but upgrade is complete.")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spinner.succeed(`IDE setup complete for ${selectedIdes.length} IDE(s)!`);
|
||||||
|
} catch (error) {
|
||||||
|
spinner.fail("IDE setup failed");
|
||||||
|
console.error(
|
||||||
|
chalk.yellow("IDE setup failed, but upgrade is complete.")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user