Skip to content

Commit

Permalink
Fixes tar on Windows
Browse files Browse the repository at this point in the history
Disable symlink copy for mingw and cygwin that on windows
  • Loading branch information
sunfishcode committed Nov 18, 2021
1 parent 438b2a7 commit 150078f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tar_from_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ else
INSTALL_DIR=/opt/wasi-sdk
fi

PKGDIR=build/wasi-sdk-$VERSION
mkdir -p build

case "$(uname -s)" in
Linux*) MACHINE=linux;;
Darwin*) MACHINE=macos;;
Expand All @@ -35,8 +32,14 @@ if [ ! -d $INSTALL_DIR ] ; then
exit 1
fi

PKGDIR=build/wasi-sdk-$VERSION
rm -rf $PKGDIR
cp -R $INSTALL_DIR $PKGDIR
if [ "$MACHINE" == "cygwin" ] || [ "$MACHINE" == "mingw" ]; then
# Copy with -L to avoid trying to create symlinks on Windows.
cp -R -L $INSTALL_DIR $PKGDIR
else
cp -R $INSTALL_DIR $PKGDIR
fi
cd build
tar czf $OUTDIR/wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION

Expand Down

0 comments on commit 150078f

Please sign in to comment.