File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
2525else
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
3339fi
3440
3541cd " ${GAP9_SDK_INSTALL_DIR} " || exit 1
You can’t perform that action at this time.
0 commit comments