Skip to content

Commit

Permalink
Work around #2591 by explicitly executing yarn.cmd when building on W…
Browse files Browse the repository at this point in the history
…indows Git Bash
  • Loading branch information
Daniel15 committed Apr 2, 2017
1 parent 349bb06 commit 41d499c
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ set -ex

umask 0022 # Ensure permissions are correct (0755 for dirs, 0644 for files)

# Workaround for https://github.com/yarnpkg/yarn/issues/2591
case "$(uname -s)" in
*CYGWIN*|MSYS*|MINGW*)
dist_yarn=dist/bin/yarn.cmd
system_yarn=yarn.cmd
;;
*)
dist_yarn=dist/bin/yarn
system_yarn=yarn
;;
esac

rm -rf artifacts dist
rm -rf dist
mkdir artifacts
mkdir dist{,/bin,/lib}

yarn run build
yarn run build-bundle
# Workaround for https://github.com/yarnpkg/yarn/issues/2591
eval $system_yarn run build
eval $system_yarn run build-bundle

cp package.json dist/
cp LICENSE dist/
Expand All @@ -21,12 +34,7 @@ cp -r bin/node-gyp-bin dist/bin/
# We cannot bundle v8-compile-cache as it must be loaded separately to be effective.
cp node_modules/v8-compile-cache/v8-compile-cache.js dist/lib/v8-compile-cache.js

case "$(uname -s)" in
*CYGWIN*|MSYS*|MINGW*) version=`dist/bin/yarn.cmd --version`;;
*) version=`dist/bin/yarn --version`;;
esac

version=`exec $dist_yarn --version`
./scripts/set-installation-method.js $(readlink -f dist/package.json) tar

tar -cvzf artifacts/yarn-v$version.tar.gz dist/*
shasum -a 256 artifacts/yarn-*.tar.gz

0 comments on commit 41d499c

Please sign in to comment.