fix: handle existing non-git repo dir (from install.sh copy)

This commit is contained in:
Claus Lohmar 2026-07-07 18:00:44 +01:00
parent ec739975ec
commit 1298589afa

View file

@ -39,14 +39,16 @@ fi
# --- Common: ensure repo exists, pull + build ---
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ ! -d "$REPO_DIR/.git" ]; then
if [ ! -d "$REPO_DIR" ]; then
echo "[1/6] Cloning repository..."
git clone "$REPO_URL" "$REPO_DIR"
else
elif [ -d "$REPO_DIR/.git" ]; then
echo "[1/6] Pulling latest code..."
cd "$REPO_DIR" && git pull
else
echo "[1/6] Using existing code..."
fi
cd "$REPO_DIR"
cd "$REPO_DIR" 2>/dev/null || mkdir -p "$REPO_DIR"
echo "[2/6] Building binary and helper tool..."
export PATH=$PATH:/usr/local/go/bin