@ghl-ai/aw 0.1.36-beta.74 → 0.1.36-beta.76
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/commands/nuke.mjs +24 -0
- package/ecc.mjs +5 -5
- package/package.json +1 -1
package/commands/nuke.mjs
CHANGED
|
@@ -297,6 +297,30 @@ export async function nukeCommand(args) {
|
|
|
297
297
|
}
|
|
298
298
|
} catch { /* best effort */ }
|
|
299
299
|
|
|
300
|
+
// 4c. Remove old-style .aw directories (git worktrees) that git worktree list missed.
|
|
301
|
+
// After ~/.aw is deleted these become dangling — find and clean them up.
|
|
302
|
+
try {
|
|
303
|
+
const { stdout: awDirs } = await exec(
|
|
304
|
+
`find "${HOME}" -maxdepth 5 -name ".aw" -type d 2>/dev/null || true`,
|
|
305
|
+
{ encoding: 'utf8', timeout: 30000 }
|
|
306
|
+
);
|
|
307
|
+
for (const dirPath of awDirs.trim().split('\n').filter(Boolean)) {
|
|
308
|
+
if (dirPath === AW_HOME) continue; // skip ~/.aw itself
|
|
309
|
+
try {
|
|
310
|
+
const gitFile = join(dirPath, '.git');
|
|
311
|
+
const stat = lstatSync(gitFile);
|
|
312
|
+
if (stat.isFile()) {
|
|
313
|
+
const content = readFileSync(gitFile, 'utf8').trim();
|
|
314
|
+
// Old git worktree pointing into ~/.aw — safe to remove
|
|
315
|
+
if (content.includes(`${AW_HOME}/.git/`)) {
|
|
316
|
+
rmSync(dirPath, { recursive: true, force: true });
|
|
317
|
+
wtRemoved++;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
} catch { /* not a worktree or already gone */ }
|
|
321
|
+
}
|
|
322
|
+
} catch { /* best effort */ }
|
|
323
|
+
|
|
300
324
|
wtSpinner.stop(`Removed ${wtRemoved} project .aw/ link${wtRemoved !== 1 ? 's' : ''}`);
|
|
301
325
|
|
|
302
326
|
// Phase 6: remove registry clone + docs
|
package/ecc.mjs
CHANGED
|
@@ -230,15 +230,15 @@ export function uninstallAwEcc({ silent = false } = {}) {
|
|
|
230
230
|
// Clean leftover manual plugin cache from older versions
|
|
231
231
|
const oldCache = join(HOME, ".claude", "plugins", "cache", "aw");
|
|
232
232
|
if (existsSync(oldCache)) {
|
|
233
|
-
rmSync(oldCache, { recursive: true, force: true });
|
|
234
|
-
removed++;
|
|
233
|
+
try { rmSync(oldCache, { recursive: true, force: true }); removed++; } catch { /* best effort */ }
|
|
235
234
|
}
|
|
236
235
|
|
|
237
|
-
// Remove permanent aw-ecc repo clone
|
|
236
|
+
// Remove permanent aw-ecc repo clone — use rm -rf (more reliable than rmSync on git repos)
|
|
238
237
|
const repoDir = eccDir();
|
|
239
238
|
if (existsSync(repoDir)) {
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
try { execSync(`rm -rf "${repoDir}"`, { stdio: 'pipe' }); removed++; } catch {
|
|
240
|
+
try { rmSync(repoDir, { recursive: true, force: true }); removed++; } catch { /* best effort */ }
|
|
241
|
+
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
if (!silent && removed > 0)
|