File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,21 @@ if [ "$installSwiftly" == true ]; then
2222 echo " Installing swiftly"
2323 curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION} -$( uname -m) .tar.gz && tar zxf swiftly-* .tar.gz && ./swiftly init -y --skip-install
2424
25- echo " Updating environment "
26- . " /root/.local/share/swiftly/env.sh " && echo " PATH= $PATH " >> " $GITHUB_ENV " && echo " SWIFTLY_HOME_DIR= $SWIFTLY_HOME_DIR " >> " $GITHUB_ENV " && echo " SWIFTLY_BIN_DIR= $SWIFTLY_BIN_DIR " >> " $GITHUB_ENV "
25+ . " /root/.local/share/swiftly/env.sh "
26+ hash -r
2727
28- echo " Installing selected swift toolchain"
29- swiftly install --post-install-file=post-install.sh
28+ if [ -n " $GITHUB_ENV " ]; then
29+ echo " Updating GitHub environment"
30+ echo " PATH=$PATH " >> " $GITHUB_ENV " && echo " SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR " >> " $GITHUB_ENV " && echo " SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR " >> " $GITHUB_ENV "
31+ fi
32+
33+ if [ -f .swift-version ]; then
34+ echo " Installing selected swift toolchain"
35+ swiftly install --post-install-file=post-install.sh
36+ else
37+ echo " Installing latest toolchain"
38+ swiftly install --post-install-file=post-install.sh latest
39+ fi
3040
3141 if [ -f post-install.sh ]; then
3242 echo " Performing swift toolchain post-installation"
You can’t perform that action at this time.
0 commit comments