From ae57e3dc6f45f4ec9f3bd07a15e45e9e5a10ae48 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 12 Apr 2024 16:43:52 -0500 Subject: do not fail if repo already exists build_single.sh will fail on Windows (WSL2) due to `git clone` if we already did a `git submodule update --init --recursive` --- external/ios/build_boost.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'external/ios/build_boost.sh') diff --git a/external/ios/build_boost.sh b/external/ios/build_boost.sh index 1341c69..acef5c7 100755 --- a/external/ios/build_boost.sh +++ b/external/ios/build_boost.sh @@ -13,8 +13,25 @@ BOOST_LIBS="random regex graph random chrono thread filesystem system date_time echo "============================ Boost ============================" echo "Cloning Apple-Boost-BuildScript from - $BOOST_URL" -git clone -b build $BOOST_URL $BOOST_DIR_PATH -cd $BOOST_DIR_PATH + +# Check if the directory already exists. +if [ -d "$BOOST_DIR_PATH" ]; then + echo "Boost directory already exists." +else + echo "Cloning Boost from $BOOST_URL" + git clone -b build $BOOST_URL $BOOST_DIR_PATH +fi + +# Verify if the repository was cloned successfully. +if [ -d "$BOOST_DIR_PATH/.git" ]; then + echo "Boost repository cloned successfully." + cd $BOOST_DIR_PATH + git checkout build +else + echo "Failed to clone Boost repository. Exiting." + exit 1 +fi + ./boost.sh -ios \ --min-ios-version ${MIN_IOS_VERSION} \ --boost-libs "${BOOST_LIBS}" \ -- cgit v1.2.3