From 2428c5ceb06db30a091af82416586d0110313571 Mon Sep 17 00:00:00 2001 From: bcherb2 Date: Thu, 19 Nov 2026 22:01:19 -0500 Subject: [PATCH] fix: dotup parses on macOS bash 3.2; stop applying bootstrap.sh - dotup expand_deps(): bash 3.2 (macOS /bin/sh) cannot parse a case pattern inside $( ... ) unless the pattern opens with "(", so the whole script failed with a syntax error at line 107 before doing anything. Both patterns now carry the leading paren, which POSIX allows and dash and newer bash ignore. .tests/test.sh had the same construct (fzf binding check) and gets the same fix. - .chezmoiignore: bootstrap.sh is the curl-fetched installer, not a dotfile; without the entry it landed as ~/bootstrap.sh. Verified: /bin/sh -n and dash -n clean on every shell script in the repo; on macOS, toggling agents/codex pulls in core/node and toggling gpu/container-toolkit pulls in the docker group. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013FbsgpRAN9ukbXzWt2Zdwz --- .chezmoiignore | 4 ++++ .tests/test.sh | 2 +- dot_local/bin/executable_dotup | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.chezmoiignore b/.chezmoiignore index 8a95893..ba4acf2 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -11,6 +11,10 @@ # Repo documentation, not a dotfile. Without this it lands as ~/README.md. README.md +# The bare-machine installer. It is fetched and run once by curl before +# chezmoi exists; it is not a dotfile. Without this it lands as ~/bootstrap.sh. +bootstrap.sh + # chezmoi's own config directory. Never manage the thing that configures the # manager. .config/chezmoi diff --git a/.tests/test.sh b/.tests/test.sh index 165e110..fd5f3f1 100755 --- a/.tests/test.sh +++ b/.tests/test.sh @@ -373,7 +373,7 @@ p:gpu/nvidia-driver" "$hit" | sed "s|\$SELF|$D|g" \ | while read -r b; do out=$(fzf --bind "$b" &1 || true) - case $out in *nvalid*|*nknown*|*nsupported*) echo "$b" ;; esac + case $out in (*nvalid*|*nknown*|*nsupported*) echo "$b" ;; esac done; :) is "every binding parses on fzf $(fzf --version | cut -d' ' -f1)" "" "$badbind" else diff --git a/dot_local/bin/executable_dotup b/dot_local/bin/executable_dotup index 65f483b..71ed900 100755 --- a/dot_local/bin/executable_dotup +++ b/dot_local/bin/executable_dotup @@ -104,8 +104,8 @@ expand_deps() { done | tr ' ' '\n' | while read -r d; do [ -n "$d" ] || continue case $d in - */*) printf '%s\n' "$d" ;; - *) awk -F'\t' -v g="$d" '!/^[#@]/ && NF>=3 && $1==g {print $1"/"$2}' "$MANIFEST" ;; + (*/*) printf '%s\n' "$d" ;; + (*) awk -F'\t' -v g="$d" '!/^[#@]/ && NF>=3 && $1==g {print $1"/"$2}' "$MANIFEST" ;; esac done) [ "${1:-}" != invasive-stop ] || add=$(printf '%s\n' "$add" | drop_invasive)