@wipcomputer/wip-release 1.9.43 → 1.9.46
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.mjs +34 -1
- package/package.json +1 -1
package/core.mjs
CHANGED
|
@@ -499,7 +499,7 @@ function getToolDisplayName(toolPath) {
|
|
|
499
499
|
|
|
500
500
|
/**
|
|
501
501
|
* Check that the interface coverage table in README.md and SKILL.md
|
|
502
|
-
* matches the actual interfaces detected in tools
|
|
502
|
+
* matches the actual interfaces detected in tools/* subdirectories.
|
|
503
503
|
* Returns { missing: string[], ok: boolean, skipped: boolean }.
|
|
504
504
|
*/
|
|
505
505
|
function checkInterfaceCoverage(repoPath) {
|
|
@@ -1579,6 +1579,39 @@ export async function release({ repoPath, level, notes, notesSource, dryRun, noP
|
|
|
1579
1579
|
console.log(` ! Branch prune skipped: ${e.message}`);
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
+
// 12. Prune stale worktrees (#212)
|
|
1583
|
+
try {
|
|
1584
|
+
execSync('git worktree prune', { cwd: repoPath, stdio: 'pipe' });
|
|
1585
|
+
// Also check _worktrees/ for dirs whose branches are now merged
|
|
1586
|
+
const worktreesDir = join(dirname(repoPath), '_worktrees');
|
|
1587
|
+
if (existsSync(worktreesDir)) {
|
|
1588
|
+
const repoBase = basename(repoPath);
|
|
1589
|
+
const wtDirs = readdirSync(worktreesDir, { withFileTypes: true })
|
|
1590
|
+
.filter(d => d.isDirectory() && d.name.startsWith(repoBase + '--'));
|
|
1591
|
+
let wtPruned = 0;
|
|
1592
|
+
for (const d of wtDirs) {
|
|
1593
|
+
const wtPath = join(worktreesDir, d.name);
|
|
1594
|
+
try {
|
|
1595
|
+
// Check if branch is merged into main
|
|
1596
|
+
const branch = execSync('git branch --show-current', {
|
|
1597
|
+
cwd: wtPath, encoding: 'utf8', timeout: 3000
|
|
1598
|
+
}).trim();
|
|
1599
|
+
if (branch) {
|
|
1600
|
+
execSync(`git merge-base --is-ancestor "${branch}" main`, {
|
|
1601
|
+
cwd: repoPath, stdio: 'pipe', timeout: 5000
|
|
1602
|
+
});
|
|
1603
|
+
// Branch is merged. Remove worktree.
|
|
1604
|
+
execSync(`git worktree remove "${wtPath}"`, { cwd: repoPath, stdio: 'pipe' });
|
|
1605
|
+
wtPruned++;
|
|
1606
|
+
}
|
|
1607
|
+
} catch {} // Branch not merged or other issue, leave it
|
|
1608
|
+
}
|
|
1609
|
+
if (wtPruned > 0) {
|
|
1610
|
+
console.log(` ✓ Pruned ${wtPruned} merged worktree(s) from _worktrees/`);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
} catch {}
|
|
1614
|
+
|
|
1582
1615
|
// Write release marker so branch guard blocks immediate install (#73)
|
|
1583
1616
|
try {
|
|
1584
1617
|
const markerDir = join(process.env.HOME || '', '.ldm', 'state');
|
package/package.json
CHANGED