Skip to content

Commit 8ee2519

Browse files
authored
Make macOS dependencies script idempotent
Currently, when running `ci.sh` twice in a row, it redownloads packages and complains about existing directories.
1 parent b2658f6 commit 8ee2519

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/webassembly/macos/install-dependencies.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ cd $SWIFT_PATH
1313

1414
cd $SOURCE_PATH
1515

16-
wget -O dist-wasi-sdk.tgz.zip "https://github.com/swiftwasm/wasi-sdk/releases/download/0.2.0-swiftwasm/dist-macos-latest.tgz.zip"
17-
unzip dist-wasi-sdk.tgz.zip -d .
16+
[ ! -e dist-wasi-sdk.tgz.zip ] && wget -O dist-wasi-sdk.tgz.zip "https://github.com/swiftwasm/wasi-sdk/releases/download/0.2.0-swiftwasm/dist-macos-latest.tgz.zip"
17+
unzip -u dist-wasi-sdk.tgz.zip -d .
1818
WASI_SDK_TAR_PATH=$(find . -type f -name "wasi-sdk-*")
1919
WASI_SDK_FULL_NAME=$(basename $WASI_SDK_TAR_PATH -macos.tar.gz)
2020
tar xfz $WASI_SDK_TAR_PATH
21+
rm -rf ./wasi-sdk
2122
mv $WASI_SDK_FULL_NAME ./wasi-sdk
2223

2324
# Link sysroot/usr/include to sysroot/include because Darwin sysroot doesn't

0 commit comments

Comments
 (0)