Skip to content

Commit 41d499c

Browse files
committed
Work around #2591 by explicitly executing yarn.cmd when building on Windows Git Bash
1 parent 349bb06 commit 41d499c

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

scripts/build-dist.sh

+16-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ set -ex
44

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

7+
# Workaround for https://github.com/yarnpkg/yarn/issues/2591
8+
case "$(uname -s)" in
9+
*CYGWIN*|MSYS*|MINGW*)
10+
dist_yarn=dist/bin/yarn.cmd
11+
system_yarn=yarn.cmd
12+
;;
13+
*)
14+
dist_yarn=dist/bin/yarn
15+
system_yarn=yarn
16+
;;
17+
esac
18+
719
rm -rf artifacts dist
820
rm -rf dist
921
mkdir artifacts
1022
mkdir dist{,/bin,/lib}
1123

12-
yarn run build
13-
yarn run build-bundle
24+
# Workaround for https://github.com/yarnpkg/yarn/issues/2591
25+
eval $system_yarn run build
26+
eval $system_yarn run build-bundle
1427

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

24-
case "$(uname -s)" in
25-
*CYGWIN*|MSYS*|MINGW*) version=`dist/bin/yarn.cmd --version`;;
26-
*) version=`dist/bin/yarn --version`;;
27-
esac
28-
37+
version=`exec $dist_yarn --version`
2938
./scripts/set-installation-method.js $(readlink -f dist/package.json) tar
30-
3139
tar -cvzf artifacts/yarn-v$version.tar.gz dist/*
3240
shasum -a 256 artifacts/yarn-*.tar.gz

0 commit comments

Comments
 (0)