marketing-agent-team 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/install.js +63 -15
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -45,6 +45,57 @@ function banner() {
|
|
|
45
45
|
console.log('');
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
async function installBMAD() {
|
|
49
|
+
log('🚀 Auto-installing BMAD...', 'yellow');
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
log(' Cloning BMAD repository...', 'cyan');
|
|
53
|
+
execSync('git clone --depth 1 https://github.com/bmad-code-org/BMAD-METHOD.git _bmad-temp', {
|
|
54
|
+
stdio: 'inherit',
|
|
55
|
+
cwd: process.cwd()
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Move contents to _bmad
|
|
59
|
+
const tempDir = path.join(process.cwd(), '_bmad-temp');
|
|
60
|
+
const bmadDir = path.join(process.cwd(), '_bmad');
|
|
61
|
+
|
|
62
|
+
// Create _bmad directory
|
|
63
|
+
if (!fs.existsSync(bmadDir)) {
|
|
64
|
+
fs.mkdirSync(bmadDir, { recursive: true });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Copy contents from temp to _bmad
|
|
68
|
+
const copyDir = (src, dest) => {
|
|
69
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
70
|
+
for (const entry of entries) {
|
|
71
|
+
const srcPath = path.join(src, entry.name);
|
|
72
|
+
const destPath = path.join(dest, entry.name);
|
|
73
|
+
if (entry.isDirectory()) {
|
|
74
|
+
if (!fs.existsSync(destPath)) {
|
|
75
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
76
|
+
}
|
|
77
|
+
copyDir(srcPath, destPath);
|
|
78
|
+
} else {
|
|
79
|
+
fs.copyFileSync(srcPath, destPath);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
copyDir(tempDir, bmadDir);
|
|
85
|
+
|
|
86
|
+
// Clean up temp directory
|
|
87
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
88
|
+
|
|
89
|
+
log('✅ BMAD installed successfully!', 'green');
|
|
90
|
+
return true;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
log(`❌ Failed to install BMAD: ${error.message}`, 'red');
|
|
93
|
+
log(' Please install BMAD manually:', 'yellow');
|
|
94
|
+
log(' Visit: https://github.com/bmad-code-org/BMAD-METHOD', 'cyan');
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
48
99
|
async function checkBMAD() {
|
|
49
100
|
log('📋 Checking BMAD installation...', 'yellow');
|
|
50
101
|
|
|
@@ -53,11 +104,17 @@ async function checkBMAD() {
|
|
|
53
104
|
log('⚠️ BMAD structure not found in current directory!', 'yellow');
|
|
54
105
|
log(' This module requires BMAD to be installed.', 'yellow');
|
|
55
106
|
log('');
|
|
56
|
-
log('
|
|
57
|
-
log('
|
|
58
|
-
log('
|
|
59
|
-
log('
|
|
60
|
-
|
|
107
|
+
log(' Would you like to auto-install BMAD?', 'cyan');
|
|
108
|
+
log(' (This will clone the BMAD repository to your project)', 'yellow');
|
|
109
|
+
log('');
|
|
110
|
+
log(' To manually install BMAD later, visit:', 'cyan');
|
|
111
|
+
log(' https://github.com/bmad-code-org/BMAD-METHOD', 'bright');
|
|
112
|
+
|
|
113
|
+
// Auto-install BMAD
|
|
114
|
+
const success = await installBMAD();
|
|
115
|
+
if (!success) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
61
118
|
}
|
|
62
119
|
|
|
63
120
|
log('✅ BMAD structure detected', 'green');
|
|
@@ -200,16 +257,7 @@ async function main() {
|
|
|
200
257
|
log('Welcome to Marketing Agent Team!', 'green');
|
|
201
258
|
console.log('');
|
|
202
259
|
|
|
203
|
-
// Check
|
|
204
|
-
const isNpmInstall = process.env.npm_config_root !== undefined;
|
|
205
|
-
|
|
206
|
-
if (isNpmInstall) {
|
|
207
|
-
log('Detected npm install - skipping interactive setup', 'yellow');
|
|
208
|
-
log('Run "npx marketing-agent-team" after npm install completes', 'yellow');
|
|
209
|
-
process.exit(0);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Check BMAD
|
|
260
|
+
// Check BMAD (will auto-install if missing)
|
|
213
261
|
const hasBMAD = await checkBMAD();
|
|
214
262
|
if (!hasBMAD) {
|
|
215
263
|
process.exit(1);
|
package/package.json
CHANGED