multi-agents-cli 1.1.42 → 1.1.44
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/core/workflow/restart.js +16 -1
- package/package.json +1 -1
package/core/workflow/restart.js
CHANGED
|
@@ -152,7 +152,22 @@ const wipeAgent = ({ scope, agent, branch, worktreePath }) => {
|
|
|
152
152
|
const scopeContents = fs.readdirSync(scopeDir).filter(f => f !== 'CLAUDE.md');
|
|
153
153
|
if (scopeContents.length > 0) {
|
|
154
154
|
try {
|
|
155
|
-
|
|
155
|
+
// Delete each entry individually - preserve CLAUDE.md
|
|
156
|
+
for (const entry of scopeContents) {
|
|
157
|
+
fs.rmSync(require('path').join(scopeDir, entry), { recursive: true, force: true });
|
|
158
|
+
}
|
|
159
|
+
// Restore CLAUDE.md from CLI templates if missing
|
|
160
|
+
const claudePath = require('path').join(scopeDir, 'CLAUDE.md');
|
|
161
|
+
if (!fs.existsSync(claudePath)) {
|
|
162
|
+
try {
|
|
163
|
+
const globalPkg = require('child_process').execSync('npm root -g', { stdio: 'pipe', encoding: 'utf8' }).trim();
|
|
164
|
+
const tmplPath = require('path').join(globalPkg, 'multi-agents-cli', 'core', 'templates', scope, 'CLAUDE.md');
|
|
165
|
+
if (fs.existsSync(tmplPath)) {
|
|
166
|
+
fs.mkdirSync(scopeDir, { recursive: true });
|
|
167
|
+
fs.copyFileSync(tmplPath, claudePath);
|
|
168
|
+
}
|
|
169
|
+
} catch {}
|
|
170
|
+
}
|
|
156
171
|
require('child_process').execSync('git add -A', { cwd: ROOT, stdio: 'pipe' });
|
|
157
172
|
require('child_process').execSync(
|
|
158
173
|
`git commit --no-gpg-sign --no-verify -m "chore: remove ${scope} scope content for restart"`,
|
package/package.json
CHANGED