Skip to content

Commit 150078f

Browse files
committed
Fixes tar on Windows
Disable symlink copy for mingw and cygwin that on windows
1 parent 438b2a7 commit 150078f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tar_from_installation.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ else
1919
INSTALL_DIR=/opt/wasi-sdk
2020
fi
2121

22-
PKGDIR=build/wasi-sdk-$VERSION
23-
mkdir -p build
24-
2522
case "$(uname -s)" in
2623
Linux*) MACHINE=linux;;
2724
Darwin*) MACHINE=macos;;
@@ -35,8 +32,14 @@ if [ ! -d $INSTALL_DIR ] ; then
3532
exit 1
3633
fi
3734

35+
PKGDIR=build/wasi-sdk-$VERSION
3836
rm -rf $PKGDIR
39-
cp -R $INSTALL_DIR $PKGDIR
37+
if [ "$MACHINE" == "cygwin" ] || [ "$MACHINE" == "mingw" ]; then
38+
# Copy with -L to avoid trying to create symlinks on Windows.
39+
cp -R -L $INSTALL_DIR $PKGDIR
40+
else
41+
cp -R $INSTALL_DIR $PKGDIR
42+
fi
4043
cd build
4144
tar czf $OUTDIR/wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION
4245

0 commit comments

Comments
 (0)