mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
install-node: Fix shellcheck warnings.
In scripts/lib/install-node line 34:
source "$NVM_DIR/nvm.sh"
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.
In scripts/lib/install-node line 36:
export NODE_BIN="$(nvm which default)"
^-- SC2155: Declare and assign separately to avoid masking return values.
In scripts/lib/install-node line 39:
n=$(which node)
^-- SC2230: which is non-standard. Use builtin 'command -v' instead.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
7162ac43a6
commit
942bb49c29
@@ -16,7 +16,7 @@ yarn_version=1.7.0
|
|||||||
export HOME=/root
|
export HOME=/root
|
||||||
|
|
||||||
current_node_version="none"
|
current_node_version="none"
|
||||||
if node_wrapper_path="$(type -p node)"; then
|
if node_wrapper_path="$(command -v node)"; then
|
||||||
current_node_version="$(node --version)"
|
current_node_version="$(node --version)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -31,13 +31,13 @@ if [ "$current_node_version" != "v$node_version" ] || ! [ -L "$node_wrapper_path
|
|||||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck source=/dev/null
|
||||||
source "$NVM_DIR/nvm.sh"
|
source "$NVM_DIR/nvm.sh"
|
||||||
nvm install "$node_version" && nvm alias default "$node_version"
|
nvm install "$node_version" && nvm alias default "$node_version"
|
||||||
export NODE_BIN="$(nvm which default)"
|
NODE_BIN="$(nvm which default)"
|
||||||
|
|
||||||
# Fix messed-up uid=500 and group write bits produced by nvm
|
# Fix messed-up uid=500 and group write bits produced by nvm
|
||||||
n=$(which node)
|
n=${NODE_BIN%/bin/node}
|
||||||
n=${n%/bin/node}
|
|
||||||
chown -R root:root "$n"
|
chown -R root:root "$n"
|
||||||
chmod -R go-w "$n"
|
chmod -R go-w "$n"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user