diff --git a/install.sh b/install.sh index 06a98e4..e0feffe 100755 --- a/install.sh +++ b/install.sh @@ -193,6 +193,19 @@ do_install() { activate_hooks() { [[ -d "${SCRIPT_DIR}/hooks" ]] || return 0 + # Hooks are for clones you COMMIT from. A vendored copy (pi-devbox bakes + # this repo root-owned under /opt and runs install.sh as an unprivileged + # user on every boot) is not one: git refuses the repo as "dubious + # ownership", `config --local` fails, and the unguarded `git config` below + # then aborted the whole installer under set -e -- one WARN per boot, on + # every device, for a step that had nothing to do there. Skip, don't fail. + local gitdir + if ! gitdir="$(git -C "$SCRIPT_DIR" rev-parse --absolute-git-dir 2>/dev/null)" \ + || [[ ! -w "$gitdir/config" ]]; then + note "Repo hooks skipped: ${SCRIPT_DIR} is not a git clone this user can configure (vendored/read-only copy)" + return 0 + fi + local cur cur="$(git -C "$SCRIPT_DIR" config --local core.hooksPath 2>/dev/null || true)"