install-yarn: Verify that the install location is /srv/zulip-yarn.

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 <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-11-03 14:19:43 -07:00 committed by Tim Abbott
parent 071c1c617d
commit 458844a2f5
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ check_version() {
# than running yarn --version. # than running yarn --version.
link="$(command -v yarn)" \ link="$(command -v yarn)" \
&& bin="$(readlink -f "$link")" \ && 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" ] && [ "$current_version" = "$version" ]
} }