fix: handle existing non-git repo dir (from install.sh copy)
This commit is contained in:
parent
ec739975ec
commit
1298589afa
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue