From 420df90827246195d57566cff6e8761dc85b903c Mon Sep 17 00:00:00 2001 From: Phil Date: Wed, 11 Nov 2026 08:34:30 -0700 Subject: [PATCH] bin/_common.sh: don't SIGPIPE git when finding the main checkout `git worktree list --porcelain | awk '...{print $2; exit}'` exits after the first line; with 27 worktrees git is still writing, gets SIGPIPE, and under `set -o pipefail` every bin/ helper (deploy, vault-run, worktree) exited 141 with no output. Let awk read to the end instead. Co-Authored-By: Claude Opus 5.5 --- bin/_common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/_common.sh b/bin/_common.sh index ae7c4b2..e23084e 100644 --- a/bin/_common.sh +++ b/bin/_common.sh @@ -1,7 +1,9 @@ # Shared by the bin/ helpers. The main checkout holds the venv and the # (gitignored) vault files that every worktree uses. repo=$(git rev-parse --show-toplevel) -main_checkout=$(git -C "$repo" worktree list --porcelain | awk '/^worktree /{print $2; exit}') +# awk reads to the end: exiting early kills git with SIGPIPE, which pipefail +# turns into a failed script once there are enough worktrees. +main_checkout=$(git -C "$repo" worktree list --porcelain | awk '/^worktree /&&!found{print $2; found=1}') lock_dir=${XDG_RUNTIME_DIR:-/tmp}/ansible-selfhosting mkdir -p "$lock_dir" && chmod 700 "$lock_dir"