From bc5a5172dc1a712b478605534845cc6bc4d0d549 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sat, 30 May 2026 16:02:44 +0000 Subject: [PATCH] fix: git safe.directory + ownership after clone/pull - Adds safe.directory exception so git doesn't reject the repo - chown directory to invoking user after clone/pull so build works --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index b280ddf..424b8cb 100755 --- a/install.sh +++ b/install.sh @@ -104,6 +104,8 @@ echo "" # ── 1. Clone repo ──────────────────────────────────────────────── if [ -d "$INSTALL_DIR" ]; then warn "$INSTALL_DIR already exists — pulling latest..." + # Mark the repo as safe — it was created by root via sudo + sudo_if git config --global --add safe.directory "$INSTALL_DIR" 2>/dev/null || true cd "$INSTALL_DIR" sudo_if git pull else @@ -111,6 +113,8 @@ else sudo_if git clone "$REPO_URL" "$INSTALL_DIR" cd "$INSTALL_DIR" fi +# Fix ownership so the build/pull steps can write as the invoking user +sudo_if chown -R "$(whoami):$(whoami)" "$INSTALL_DIR" 2>/dev/null || true # ── 2. Build or download binary ────────────────────────────────── ARCH="$(uname -m)"