Skip to content

Commit c364f7e

Browse files
fix: return non-zero exit code when remove/prune fail due to dirty worktrees (#23)
* Initial plan * fix: return non-zero exit code when remove/prune fail due to dirty worktrees Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
1 parent ce7fee6 commit c364f7e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/commands/prune.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ async function runPrune(options: PruneCommandOptions): Promise<void> {
209209
if (worktreesToRemove.length === 0) {
210210
console.log(chalk.yellow("No worktrees to remove (all candidates have uncommitted changes)."));
211211
console.log(chalk.yellow("Use --force to remove them anyway."));
212-
return;
212+
process.exit(1);
213213
}
214214

215215
console.log(chalk.blue("\nRemoving worktrees..."));

src/commands/remove.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async function runRemove(
8181
console.log(
8282
chalk.yellow("Use --force to remove it anyway, or commit/stash your changes first."),
8383
);
84-
return;
84+
process.exit(1);
8585
}
8686

8787
// Confirm removal

0 commit comments

Comments
 (0)