chore: fix installation directory handling to use .bmad-core as default path
- Remove redundant ./ prefix from default directory - Update all default paths from ./.bmad-core to .bmad-core - Add logic to handle direct .bmad-core path selection - Treat parent as project root when .bmad-core specified - Simplify directory state detection for existing files - Remove unknown_existing state type from installer logic
This commit is contained in:
parent
25c356b415
commit
47794f301d
|
|
@ -37,7 +37,7 @@ program
|
|||
.description('Install BMAD Method agents and tools')
|
||||
.option('-f, --full', 'Install complete .bmad-core folder')
|
||||
.option('-a, --agent <agent>', 'Install specific agent with dependencies')
|
||||
.option('-d, --directory <path>', 'Installation directory (default: ./bmad-core)')
|
||||
.option('-d, --directory <path>', 'Installation directory (default: .bmad-core)')
|
||||
.option('-i, --ide <ide>', 'Configure for specific IDE (cursor, claude-code, windsurf, roo)')
|
||||
.action(async (options) => {
|
||||
try {
|
||||
|
|
@ -50,7 +50,7 @@ program
|
|||
const config = {
|
||||
installType: options.full ? 'full' : 'single-agent',
|
||||
agent: options.agent,
|
||||
directory: options.directory || './.bmad-core',
|
||||
directory: options.directory || '.bmad-core',
|
||||
ide: options.ide
|
||||
};
|
||||
await installer.install(config);
|
||||
|
|
@ -110,7 +110,7 @@ async function promptInstallation() {
|
|||
type: 'input',
|
||||
name: 'directory',
|
||||
message: 'Where would you like to install BMAD?',
|
||||
default: './.bmad-core'
|
||||
default: '.bmad-core'
|
||||
}
|
||||
]);
|
||||
answers.directory = directory;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ class Installer {
|
|||
|
||||
try {
|
||||
// Resolve installation directory
|
||||
const installDir = path.resolve(config.directory);
|
||||
let installDir = path.resolve(config.directory);
|
||||
if (path.basename(installDir) === '.bmad-core') {
|
||||
// If user points directly to .bmad-core, treat its parent as the project root
|
||||
installDir = path.dirname(installDir);
|
||||
}
|
||||
|
||||
// Detect current state
|
||||
const state = await this.detectInstallationState(installDir);
|
||||
|
|
@ -103,9 +107,9 @@ class Installer {
|
|||
});
|
||||
|
||||
if (files.length > 0) {
|
||||
state.type = "unknown_existing";
|
||||
// Directory has other files, but no BMAD installation.
|
||||
// Treat as clean install but record that it isn't empty.
|
||||
state.hasOtherFiles = true;
|
||||
return state;
|
||||
}
|
||||
|
||||
return state; // clean install
|
||||
|
|
|
|||
Loading…
Reference in New Issue