install-node: Fix leaking of $HOME.

This fixes a bug where provision was failing since our most recent
upgrade to yarn/nvm/node.

It turns out my original fix was the correct fix, but to the wrong
third-party tool: nvm, not yarn, was the offender.
This commit is contained in:
Tim Abbott 2018-04-12 14:25:30 -07:00
parent f56b4b7ec2
commit 105eed049e
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,11 @@ YARN_BIN="$ZULIP_SRV/zulip-yarn/bin/yarn"
node_version=8.11.1
yarn_version=1.5.1
# This is a fix for the fact that nvm uses $HOME to determine which
# user account's home directory to ~/.config to. Ideally, we'd have a
# more systematic fix, like using `sudo -H` everywhere.
export HOME=/root
current_node_version="none"
if hash node 2>/dev/null; then
current_node_version="$(node --version)"

View File

@ -248,7 +248,7 @@ def main(options):
print("No changes to apt dependencies, so skipping apt operations.")
# Here we install node.
run(["sudo", "scripts/lib/install-node"])
run(["sudo", "-H", "scripts/lib/install-node"])
# This is a wrapper around `yarn`, which we run last since
# it can often fail due to network issues beyond our control.