Skip to content

Commit ca7eb6f

Browse files
committed
Fix GAP9 SDK Build
1 parent 09a3856 commit ca7eb6f

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

scripts/gap9-build_sdk.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ if [ -d "${GAP9_SDK_INSTALL_DIR}/.git" ]; then
2323
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
2424
git remote set-url origin "${GAP_SDK_URL}" || true
2525
else
26-
echo "Directory exists but .git folder is missing. Reinitializing git repository..."
27-
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
28-
git init
29-
git remote add origin "${GAP_SDK_URL}"
30-
git fetch --all --tags || true
31-
git reset --soft "${GAP9_SDK_COMMIT_HASH}"
32-
git add .
26+
if [ ! -d "${GAP9_SDK_INSTALL_DIR}" ]; then
27+
echo "Directory ${GAP9_SDK_INSTALL_DIR} does not exist. Cloning fresh..."
28+
git clone "${GAP_SDK_URL}" "${GAP9_SDK_INSTALL_DIR}"
29+
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
30+
else
31+
echo "Directory exists but .git folder is missing. Reinitializing git repository..."
32+
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
33+
git init
34+
git remote add origin "${GAP_SDK_URL}"
35+
git fetch --all --tags || true
36+
git reset --soft "${GAP9_SDK_COMMIT_HASH}"
37+
git add .
38+
fi
3339
fi
3440

3541
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1

0 commit comments

Comments
 (0)