Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit ccf90c3

Browse files
committed
Check env when populating cache
1 parent e0b77be commit ccf90c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

run-build-functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,13 +705,13 @@ cache_artifacts() {
705705
fi
706706

707707
# cache the version of Swift installed
708-
if [ -d $SWIFTENV_ROOT/versions/$SWIFT_VERSION ]
708+
if [ -n "$SWIFT_VERSION" ] && [ -d "$SWIFTENV_ROOT/versions/$SWIFT_VERSION" ]
709709
then
710710
if ! [ -d $NETLIFY_CACHE_DIR/swift_version/$SWIFT_VERSION ]
711711
then
712712
rm -rf $NETLIFY_CACHE_DIR/swift_version
713713
mkdir $NETLIFY_CACHE_DIR/swift_version
714-
mv $SWIFTENV_ROOT/versions/$SWIFT_VERSION $NETLIFY_CACHE_DIR/swift_version/
714+
mv "$SWIFTENV_ROOT/versions/$SWIFT_VERSION" $NETLIFY_CACHE_DIR/swift_version/
715715
echo "Cached Swift version $SWIFT_VERSION"
716716
fi
717717
else

0 commit comments

Comments
 (0)