jj-ws-forget (332B)
1 #!/usr/bin/env zsh 2 set -euo pipefail 3 4 if (( # == 0 )); then 5 print -u2 "Usage: jj-ws-forget <destination_path>" 6 exit 1 7 fi 8 9 # Resolve absolute workspace path and name. 10 DEST_ABS="${1:a}" 11 WS_NAME="${DEST_ABS:t}" 12 13 # Forget the workspace and delete the git worktree. 14 jj workspace forget "$WS_NAME" 15 git worktree remove -f "$DEST_ABS"