From 458844a2f560502ffa387918aa670b1f38871e67 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 3 Nov 2021 14:19:43 -0700 Subject: [PATCH] install-yarn: Verify that the install location is /srv/zulip-yarn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scripts.lib.node_cache expects Yarn to be in /srv/zulip-yarn, so if it’s installed somewhere else, even if it’s the right version, we need to reinstall it. Signed-off-by: Anders Kaseorg --- scripts/lib/install-yarn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/lib/install-yarn b/scripts/lib/install-yarn index fa8ba03906..2aa8fd81f8 100755 --- a/scripts/lib/install-yarn +++ b/scripts/lib/install-yarn @@ -10,7 +10,8 @@ check_version() { # than running yarn --version. link="$(command -v yarn)" \ && bin="$(readlink -f "$link")" \ - && current_version="$(jq -r '.version' "${bin%/*/*}/package.json")" \ + && [ "$bin" = /srv/zulip-yarn/bin/yarn ] \ + && current_version="$(jq -r '.version' /srv/zulip-yarn/package.json)" \ && [ "$current_version" = "$version" ] }