mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
quickinstall duplicate success message removed
This commit is contained in:
@@ -2,6 +2,7 @@ const path = require('node:path');
|
||||
const fs = require('fs-extra');
|
||||
const { BaseIdeSetup } = require('./_base-ide');
|
||||
const chalk = require('chalk');
|
||||
const { FileOps, PathUtils } = require('../../../lib/file-ops');
|
||||
const { getProjectRoot, getSourcePath, getModulePath } = require('../../../lib/project-root');
|
||||
const { WorkflowCommandGenerator } = require('./shared/workflow-command-generator');
|
||||
const { TaskToolCommandGenerator } = require('./shared/task-tool-command-generator');
|
||||
@@ -88,9 +89,9 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
* @param {string} projectDir - Project directory
|
||||
*/
|
||||
async cleanup(projectDir) {
|
||||
const bmadWorkflowsDir = path.join(projectDir, this.configDir, this.workflowsDir, 'bmad');
|
||||
const bmadWorkflowsDir = PathUtils.getIdeSubDir(projectDir, this.configDir, this.workflowsDir, 'bmad');
|
||||
|
||||
if (await fs.pathExists(bmadWorkflowsDir)) {
|
||||
if (await this.exists(bmadWorkflowsDir)) {
|
||||
await fs.remove(bmadWorkflowsDir);
|
||||
console.log(chalk.dim(` Removed old BMAD workflows from ${this.name}`));
|
||||
}
|
||||
@@ -112,9 +113,9 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
await this.cleanup(projectDir);
|
||||
|
||||
// Create .agent/workflows directory structure
|
||||
const agentDir = path.join(projectDir, this.configDir);
|
||||
const workflowsDir = path.join(agentDir, this.workflowsDir);
|
||||
const bmadWorkflowsDir = path.join(workflowsDir, 'bmad');
|
||||
const agentDir = PathUtils.getConfigDir(projectDir, this.configDir);
|
||||
const workflowsDir = PathUtils.getIdeSubDir(projectDir, this.configDir, this.workflowsDir);
|
||||
const bmadWorkflowsDir = PathUtils.getIdeSubDir(projectDir, this.configDir, this.workflowsDir, 'bmad');
|
||||
|
||||
await this.ensureDir(bmadWorkflowsDir);
|
||||
|
||||
@@ -190,7 +191,7 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
* Read and process file content
|
||||
*/
|
||||
async readAndProcess(filePath, metadata) {
|
||||
const content = await fs.readFile(filePath, 'utf8');
|
||||
const content = await this.readFile(filePath);
|
||||
return this.processContent(content, metadata);
|
||||
}
|
||||
|
||||
@@ -210,7 +211,7 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
|
||||
// Add core agents
|
||||
const corePath = getModulePath('core');
|
||||
if (await fs.pathExists(path.join(corePath, 'agents'))) {
|
||||
if (await this.exists(path.join(corePath, 'agents'))) {
|
||||
const coreAgents = await getAgentsFromDir(path.join(corePath, 'agents'), 'core');
|
||||
agents.push(...coreAgents);
|
||||
}
|
||||
@@ -220,7 +221,7 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
const modulePath = path.join(sourceDir, moduleName);
|
||||
const agentsPath = path.join(modulePath, 'agents');
|
||||
|
||||
if (await fs.pathExists(agentsPath)) {
|
||||
if (await this.exists(agentsPath)) {
|
||||
const moduleAgents = await getAgentsFromDir(agentsPath, moduleName);
|
||||
agents.push(...moduleAgents);
|
||||
}
|
||||
@@ -387,7 +388,7 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
const targetPath = path.join(projectDir, injection.file);
|
||||
|
||||
if (await this.exists(targetPath)) {
|
||||
let content = await fs.readFile(targetPath, 'utf8');
|
||||
let content = await this.readFile(targetPath);
|
||||
const marker = `<!-- IDE-INJECT-POINT: ${injection.point} -->`;
|
||||
|
||||
if (content.includes(marker)) {
|
||||
@@ -399,7 +400,7 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
}
|
||||
|
||||
content = content.replace(marker, injectionContent);
|
||||
await fs.writeFile(targetPath, content);
|
||||
await this.writeFile(targetPath, content);
|
||||
console.log(chalk.dim(` Injected: ${injection.point} → ${injection.file}`));
|
||||
}
|
||||
}
|
||||
@@ -417,7 +418,7 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
targetDir = path.join(os.homedir(), '.agent', 'agents');
|
||||
console.log(chalk.dim(` Installing subagents globally to: ~/.agent/agents/`));
|
||||
} else {
|
||||
targetDir = path.join(projectDir, '.agent', 'agents');
|
||||
targetDir = PathUtils.getIdeSubDir(projectDir, '.agent', 'agents');
|
||||
console.log(chalk.dim(` Installing subagents to project: .agent/agents/`));
|
||||
}
|
||||
|
||||
@@ -464,11 +465,11 @@ class AntigravitySetup extends BaseIdeSetup {
|
||||
*/
|
||||
async installCustomAgentLauncher(projectDir, agentName, agentPath, metadata) {
|
||||
// Create .agent/workflows/bmad directory structure (same as regular agents)
|
||||
const agentDir = path.join(projectDir, this.configDir);
|
||||
const workflowsDir = path.join(agentDir, this.workflowsDir);
|
||||
const bmadWorkflowsDir = path.join(workflowsDir, 'bmad');
|
||||
const agentDir = PathUtils.getConfigDir(projectDir, this.configDir);
|
||||
const workflowsDir = PathUtils.getIdeSubDir(projectDir, this.configDir, this.workflowsDir);
|
||||
const bmadWorkflowsDir = PathUtils.getIdeSubDir(projectDir, this.configDir, this.workflowsDir, 'bmad');
|
||||
|
||||
await fs.ensureDir(bmadWorkflowsDir);
|
||||
await this.ensureDir(bmadWorkflowsDir);
|
||||
|
||||
// Create custom agent launcher with same pattern as regular agents
|
||||
const launcherContent = `name: '${agentName}'
|
||||
@@ -493,7 +494,7 @@ usage: |
|
||||
const launcherPath = path.join(bmadWorkflowsDir, fileName);
|
||||
|
||||
// Write the launcher file
|
||||
await fs.writeFile(launcherPath, launcherContent, 'utf8');
|
||||
await this.writeFile(launcherPath, launcherContent);
|
||||
|
||||
return {
|
||||
ide: 'antigravity',
|
||||
|
||||
Reference in New Issue
Block a user