From 376194944f41e835dc3290e9dccd30210f75d760 Mon Sep 17 00:00:00 2001 From: Wiley Kestner Date: Mon, 15 Jan 2018 20:01:22 -0800 Subject: [PATCH] Clone swiftenv manually if .git folder has been removed. --- bin/steps/swiftenv | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/steps/swiftenv b/bin/steps/swiftenv index 8d034165..36fa920b 100644 --- a/bin/steps/swiftenv +++ b/bin/steps/swiftenv @@ -1,10 +1,17 @@ # Fetch swiftenv -unset GIT_DIR -git submodule update --init --recursive >/dev/null -# Activate swiftenv +unset GIT_DIR export SWIFTENV_ROOT="$CACHE_DIR/swiftenv" export PATH="$ROOT_DIR/swiftenv/bin:$PATH" + +if [ -d ".git" ]; then + git submodule update --init --recursive >/dev/null +else + rm -rf $SWIFTENV_ROOT + git clone https://github.com/kylef/swiftenv.git $SWIFTENV_ROOT +fi + +# Activate swiftenv eval "$(swiftenv init -)" if ! [ -f "$BUILD_DIR/.swift-version" ] && [ -z "$SWIFT_VERSION" ]; then