multi-agents-cli 1.0.25 → 1.0.27
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/init.js +14 -16
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -88,25 +88,23 @@ if (isGlobalCLI) {
|
|
|
88
88
|
const targetDir = path.resolve(process.cwd(), projectArg);
|
|
89
89
|
|
|
90
90
|
if (fs.existsSync(targetDir)) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
fs.mkdirSync(targetDir, { recursive: true });
|
|
97
|
-
process.chdir(targetDir);
|
|
91
|
+
process.chdir(targetDir);
|
|
92
|
+
} else {
|
|
93
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
94
|
+
process.chdir(targetDir);
|
|
98
95
|
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
execSync('git init -b main', { cwd: targetDir, stdio: 'pipe' });
|
|
102
|
-
execSync('git commit --allow-empty -m "init: project created"', { cwd: targetDir, stdio: 'pipe' });
|
|
103
|
-
} catch {
|
|
104
|
-
// Fallback for older git versions that don't support -b flag
|
|
96
|
+
// Initialize git
|
|
105
97
|
try {
|
|
106
|
-
execSync('git init', { cwd: targetDir, stdio: 'pipe' });
|
|
107
|
-
execSync('git checkout -b main', { cwd: targetDir, stdio: 'pipe' });
|
|
98
|
+
execSync('git init -b main', { cwd: targetDir, stdio: 'pipe' });
|
|
108
99
|
execSync('git commit --allow-empty -m "init: project created"', { cwd: targetDir, stdio: 'pipe' });
|
|
109
|
-
} catch {
|
|
100
|
+
} catch {
|
|
101
|
+
// Fallback for older git versions that don't support -b flag
|
|
102
|
+
try {
|
|
103
|
+
execSync('git init', { cwd: targetDir, stdio: 'pipe' });
|
|
104
|
+
execSync('git checkout -b main', { cwd: targetDir, stdio: 'pipe' });
|
|
105
|
+
execSync('git commit --allow-empty -m "init: project created"', { cwd: targetDir, stdio: 'pipe' });
|
|
106
|
+
} catch { /* continue */ }
|
|
107
|
+
}
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
|
package/package.json
CHANGED