[shellcheck] disable intentional violations via comments
parent
cbeb654692
commit
2228323c0b
8
nvm.sh
8
nvm.sh
|
@ -7,7 +7,7 @@
|
||||||
# with much bash help from Matthew Ranney
|
# with much bash help from Matthew Ranney
|
||||||
|
|
||||||
# "local" warning, quote expansion warning
|
# "local" warning, quote expansion warning
|
||||||
# shellcheck disable=SC2039,SC2016
|
# shellcheck disable=SC2039,SC2016,SC2001
|
||||||
{ # this ensures the entire script is downloaded #
|
{ # this ensures the entire script is downloaded #
|
||||||
|
|
||||||
NVM_SCRIPT_SOURCE="$_"
|
NVM_SCRIPT_SOURCE="$_"
|
||||||
|
@ -15,6 +15,7 @@ NVM_SCRIPT_SOURCE="$_"
|
||||||
nvm_echo() {
|
nvm_echo() {
|
||||||
command printf %s\\n "$*" 2>/dev/null || {
|
command printf %s\\n "$*" 2>/dev/null || {
|
||||||
nvm_echo() {
|
nvm_echo() {
|
||||||
|
# shellcheck disable=SC1001
|
||||||
\printf %s\\n "$*" # on zsh, `command printf` sometimes fails
|
\printf %s\\n "$*" # on zsh, `command printf` sometimes fails
|
||||||
}
|
}
|
||||||
nvm_echo "$@"
|
nvm_echo "$@"
|
||||||
|
@ -35,6 +36,7 @@ nvm_has() {
|
||||||
|
|
||||||
nvm_is_alias() {
|
nvm_is_alias() {
|
||||||
# this is intentionally not "command alias" so it works in zsh.
|
# this is intentionally not "command alias" so it works in zsh.
|
||||||
|
# shellcheck disable=SC1001
|
||||||
\alias "${1-}" > /dev/null 2>&1
|
\alias "${1-}" > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +74,7 @@ nvm_download() {
|
||||||
-e 's/-s /-q /' \
|
-e 's/-s /-q /' \
|
||||||
-e 's/-o /-O /' \
|
-e 's/-o /-O /' \
|
||||||
-e 's/-C - /-c /')
|
-e 's/-C - /-c /')
|
||||||
|
# shellcheck disable=SC2086
|
||||||
eval wget $ARGS
|
eval wget $ARGS
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -108,8 +111,10 @@ fi
|
||||||
if [ -z "${NVM_DIR-}" ]; then
|
if [ -z "${NVM_DIR-}" ]; then
|
||||||
# shellcheck disable=SC2128
|
# shellcheck disable=SC2128
|
||||||
if [ -n "${BASH_SOURCE-}" ]; then
|
if [ -n "${BASH_SOURCE-}" ]; then
|
||||||
|
# shellcheck disable=SC2169
|
||||||
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
|
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
|
||||||
fi
|
fi
|
||||||
|
# shellcheck disable=SC1001
|
||||||
NVM_DIR="$(cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" > /dev/null && \pwd)"
|
NVM_DIR="$(cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" > /dev/null && \pwd)"
|
||||||
export NVM_DIR
|
export NVM_DIR
|
||||||
fi
|
fi
|
||||||
|
@ -1664,6 +1669,7 @@ nvm_install_node_source() {
|
||||||
tarball="$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz"
|
tarball="$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
if (
|
if (
|
||||||
[ -n "$tarball" ] && \
|
[ -n "$tarball" ] && \
|
||||||
command mkdir -p "$tmpdir" && \
|
command mkdir -p "$tmpdir" && \
|
||||||
|
|
Loading…
Reference in New Issue