@ghl-ai/aw 0.1.36-beta.51 → 0.1.36-beta.53
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 +0 -19
- package/git.mjs +6 -0
- package/package.json +1 -1
package/commands/nuke.mjs
CHANGED
|
@@ -139,25 +139,6 @@ async function removeProjectSymlinks() {
|
|
|
139
139
|
try { unlinkSync(linkPath); removed++; } catch { /* best effort */ }
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
// Find and remove stale project-level .aw git worktree directories.
|
|
143
|
-
// maxdepth 4 covers HOME/org/repo/.aw and completes in <1s on large home dirs.
|
|
144
|
-
// (maxdepth 6 took 12s+ due to Library/ and .claude/plugins/cache/ scanning)
|
|
145
|
-
// ~/.aw itself is skipped — Phase 6 handles it.
|
|
146
|
-
const AW_HOME_PATH = join(HOME, '.aw');
|
|
147
|
-
const { stdout: awDirs } = await exec(
|
|
148
|
-
`find "${HOME}" -maxdepth 4 -name ".aw" -type d 2>/dev/null || true`,
|
|
149
|
-
{ encoding: 'utf8', timeout: 30000 }
|
|
150
|
-
);
|
|
151
|
-
for (const awDir of awDirs.trim().split('\n').filter(Boolean)) {
|
|
152
|
-
if (awDir === AW_HOME_PATH) continue; // ~/.aw removed in Phase 6
|
|
153
|
-
try {
|
|
154
|
-
if (lstatSync(join(awDir, '.git')).isFile()) {
|
|
155
|
-
execSync(`rm -rf "${awDir}"`, { stdio: 'pipe' });
|
|
156
|
-
removed++;
|
|
157
|
-
}
|
|
158
|
-
} catch { /* best effort */ }
|
|
159
|
-
}
|
|
160
|
-
|
|
161
142
|
// Also remove legacy local .git/hooks/post-checkout installed by old aw versions
|
|
162
143
|
let hooksRemoved = 0;
|
|
163
144
|
const { stdout: hookFiles } = await exec(
|
package/git.mjs
CHANGED
|
@@ -116,6 +116,12 @@ export function isValidClone(awHome, repoUrl) {
|
|
|
116
116
|
* sparsePaths: array of repo-relative paths to include (e.g. ['.aw_registry/platform', 'content'])
|
|
117
117
|
*/
|
|
118
118
|
export async function initPersistentClone(repoUrl, awHome, sparsePaths) {
|
|
119
|
+
// If awHome exists but is not a valid clone (e.g. leftover ~/.aw/hooks/ from a partial
|
|
120
|
+
// nuke or failed init), wipe it so git clone can proceed cleanly.
|
|
121
|
+
if (existsSync(awHome) && !isValidClone(awHome, repoUrl)) {
|
|
122
|
+
try { execSync(`rm -rf "${awHome}"`, { stdio: 'pipe' }); } catch {}
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
try {
|
|
120
126
|
await exec(`git clone --filter=blob:none --no-checkout "${repoUrl}" "${awHome}"`);
|
|
121
127
|
} catch (e) {
|