From 2a29d4b312ec2251bc0eab8f6ee43749e9ea0436 Mon Sep 17 00:00:00 2001 From: vishalan Date: Wed, 11 Nov 2026 14:01:48 +0530 Subject: [PATCH] fix(scripts): tolerate SIGPIPE in bootstrap_secrets randstr `head -c` closes the pipe once it has enough bytes, so `tr` exits 141. Under `set -euo pipefail` the command substitution then aborts the script on a fresh checkout (no secrets/*.env yet), failing `make test` at setup_secrets with Error 141. Co-Authored-By: Claude Sonnet 5.5 --- scripts/bootstrap_secrets.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap_secrets.sh b/scripts/bootstrap_secrets.sh index a36c4329..9272aa64 100755 --- a/scripts/bootstrap_secrets.sh +++ b/scripts/bootstrap_secrets.sh @@ -17,7 +17,9 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SECRETS_DIR="$(cd "${SCRIPT_DIR}/../secrets" && pwd)" -randstr() { LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c "$1"; } +# `head` closes the pipe once it has enough bytes, so `tr` dies with SIGPIPE +# (141). Under `set -o pipefail` that would abort the script, so tolerate it. +randstr() { LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c "$1" || true; } # Extract a KEY=value from a file, or empty string if absent. readval() {