diff --git a/scripts/lib/install-yarn b/scripts/lib/install-yarn index 46f05808b6..c457428998 100755 --- a/scripts/lib/install-yarn +++ b/scripts/lib/install-yarn @@ -8,9 +8,7 @@ tarball="yarn-$version.tgz" check_version() { # Reading the version of Yarn from its package.json is much faster # than running yarn --version. - link="$(command -v yarn)" \ - && [ "$link" -ef /srv/zulip-yarn/bin/yarn ] \ - && current_version="$(jq -r '.version' /srv/zulip-yarn/package.json)" \ + current_version="$(jq -r '.version' /srv/zulip-yarn/package.json)" \ && [ "$current_version" = "$version" ] } @@ -23,6 +21,5 @@ if ! check_version; then rm -rf /srv/zulip-yarn mkdir /srv/zulip-yarn tar -xzf "$tarball" --no-same-owner --strip-components=1 -C /srv/zulip-yarn - ln -nsf /srv/zulip-yarn/bin/yarn /usr/bin/yarn check_version fi diff --git a/tools/ci/production-build b/tools/ci/production-build index bedfec147e..a524afec75 100755 --- a/tools/ci/production-build +++ b/tools/ci/production-build @@ -44,8 +44,10 @@ cp -a \ /tmp/production-build # Check that webpack bundles use only ES2019 syntax. +# Use the yarn binary installed by tools/provision. +YARN="/srv/zulip-yarn/bin/yarn" tar -C /tmp -xzf /tmp/production-build/zulip-server-test.tar.gz zulip-server-test/prod-static/serve/webpack-bundles ( GLOBIGNORE=/tmp/zulip-server-test/prod-static/serve/webpack-bundles/katex-cli.js - yarn run es-check es2019 /tmp/zulip-server-test/prod-static/serve/webpack-bundles/*.js + $YARN run es-check es2019 /tmp/zulip-server-test/prod-static/serve/webpack-bundles/*.js ) diff --git a/tools/setup/optimize-svg b/tools/setup/optimize-svg index 0ac5f67c02..23efbb4295 100755 --- a/tools/setup/optimize-svg +++ b/tools/setup/optimize-svg @@ -42,6 +42,7 @@ if [ "$#" -gt 0 ]; then fi ZULIP_PATH="$(readlink -f "$(dirname "$0")"/../..)" +YARN="/srv/zulip-yarn/bin/yarn" if [ -n "$CHECK_UNOPTIMIZED" ]; then if [ "$(node_modules/.bin/svgo -f static/images/integrations/logos | grep -o '\.[0-9]% = ' | wc -l)" -ge 1 ]; then @@ -52,6 +53,6 @@ if [ -n "$CHECK_UNOPTIMIZED" ]; then echo "SUCCESS: SVG files in static/images/integrations/logos are all optimized!" fi else - yarn run svgo -q -f static/images/integrations/logos + $YARN run svgo -q -f static/images/integrations/logos "$ZULIP_PATH"/tools/setup/generate_integration_bots_avatars.py fi