claude-issue-solver 1.8.0 → 1.8.1
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/dist/commands/clean.js +22 -1
- package/package.json +1 -1
package/dist/commands/clean.js
CHANGED
|
@@ -223,11 +223,19 @@ function getIssueWorktrees() {
|
|
|
223
223
|
}
|
|
224
224
|
async function cleanAllCommand() {
|
|
225
225
|
const projectRoot = (0, git_1.getProjectRoot)();
|
|
226
|
+
const currentDir = process.cwd();
|
|
226
227
|
const worktrees = getIssueWorktrees();
|
|
227
228
|
if (worktrees.length === 0) {
|
|
228
229
|
console.log(chalk_1.default.yellow('\nNo issue worktrees found.'));
|
|
229
230
|
return;
|
|
230
231
|
}
|
|
232
|
+
// Warn if user is inside a worktree that might be deleted
|
|
233
|
+
const inWorktree = worktrees.find((wt) => currentDir.startsWith(wt.path));
|
|
234
|
+
if (inWorktree) {
|
|
235
|
+
console.log(chalk_1.default.yellow(`\n⚠️ You are inside worktree #${inWorktree.issueNumber}`));
|
|
236
|
+
console.log(chalk_1.default.yellow(` Run this command from the main project directory for best results.`));
|
|
237
|
+
console.log(chalk_1.default.dim(` cd ${projectRoot}\n`));
|
|
238
|
+
}
|
|
231
239
|
// Fetch status for all worktrees
|
|
232
240
|
const statusSpinner = (0, ora_1.default)('Fetching issue and PR status...').start();
|
|
233
241
|
const worktreesWithStatus = worktrees.map((wt) => ({
|
|
@@ -495,11 +503,19 @@ async function cleanCommand(issueNumber) {
|
|
|
495
503
|
}
|
|
496
504
|
async function cleanMergedCommand() {
|
|
497
505
|
const projectRoot = (0, git_1.getProjectRoot)();
|
|
506
|
+
const currentDir = process.cwd();
|
|
498
507
|
const worktrees = getIssueWorktrees();
|
|
499
508
|
if (worktrees.length === 0) {
|
|
500
509
|
console.log(chalk_1.default.yellow('\nNo issue worktrees found.'));
|
|
501
510
|
return;
|
|
502
511
|
}
|
|
512
|
+
// Warn if user is inside a worktree that might be deleted
|
|
513
|
+
const inWorktree = worktrees.find((wt) => currentDir.startsWith(wt.path));
|
|
514
|
+
if (inWorktree) {
|
|
515
|
+
console.log(chalk_1.default.yellow(`\n⚠️ You are inside worktree #${inWorktree.issueNumber}`));
|
|
516
|
+
console.log(chalk_1.default.yellow(` Run this command from the main project directory for best results.`));
|
|
517
|
+
console.log(chalk_1.default.dim(` cd ${projectRoot}\n`));
|
|
518
|
+
}
|
|
503
519
|
// Fetch status for all worktrees
|
|
504
520
|
const statusSpinner = (0, ora_1.default)('Fetching PR status...').start();
|
|
505
521
|
const worktreesWithStatus = worktrees.map((wt) => ({
|
|
@@ -606,7 +622,12 @@ async function cleanMergedCommand() {
|
|
|
606
622
|
}
|
|
607
623
|
}
|
|
608
624
|
// Prune stale worktrees
|
|
609
|
-
|
|
625
|
+
try {
|
|
626
|
+
(0, child_process_1.execSync)('git worktree prune', { cwd: projectRoot, stdio: 'pipe' });
|
|
627
|
+
}
|
|
628
|
+
catch {
|
|
629
|
+
// May fail if current directory was deleted
|
|
630
|
+
}
|
|
610
631
|
console.log();
|
|
611
632
|
console.log(chalk_1.default.green(`✅ Cleaned up ${mergedWorktrees.length} merged worktree(s)!`));
|
|
612
633
|
}
|