Skip to content

fix: handle setup/teardown command failures gracefully#4

Merged
vojtabiberle merged 2 commits intomasterfrom
fix/graceful-setup-teardown-failures
Mar 4, 2026
Merged

fix: handle setup/teardown command failures gracefully#4
vojtabiberle merged 2 commits intomasterfrom
fix/graceful-setup-teardown-failures

Conversation

@vojtabiberle
Copy link
Copy Markdown
Owner

Summary

  • Warn and continue when setup or teardown commands fail (e.g., when a worktree branch predates the configured script)
  • Skip teardown entirely if the worktree directory is already gone
  • Fixes confusing raw bash "file not found" errors during wt rm

Test plan

  • Reproduced with wt rm on a branch that predates bin/worktree-teardown
  • Verified wt add + wt rm works normally on a branch that has the scripts

When a worktree branch predates a setup or teardown script configured
in worktree.conf, the command fails with a confusing "file not found"
bash error. Now we warn and continue instead of showing a raw error.
Also skip teardown entirely if the worktree directory is already gone.
@vojtabiberle vojtabiberle merged commit c08fae5 into master Mar 4, 2026
1 check passed
@vojtabiberle vojtabiberle deleted the fix/graceful-setup-teardown-failures branch March 4, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant