[shellcheck] update for new warnings in v0.7.2

Jordan Harband 2021-05-03 14:19:31 -07:00
parent fc87226b23
commit b5165ecbe4
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 8 additions and 4 deletions

12
nvm.sh
View File

@ -6,10 +6,11 @@
# Implemented by Tim Caswell <tim@creationix.com> # Implemented by Tim Caswell <tim@creationix.com>
# with much bash help from Matthew Ranney # with much bash help from Matthew Ranney
# "local" warning, quote expansion warning # "local" warning, quote expansion warning, sed warning, `local` warning
# shellcheck disable=SC2039,SC2016,SC2001 # shellcheck disable=SC2039,SC2016,SC2001,SC3043
{ # this ensures the entire script is downloaded # { # this ensures the entire script is downloaded #
# shellcheck disable=SC3028
NVM_SCRIPT_SOURCE="$_" NVM_SCRIPT_SOURCE="$_"
nvm_is_zsh() { nvm_is_zsh() {
@ -309,7 +310,7 @@ 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 # shellcheck disable=SC2169,SC3054
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}" NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
fi fi
NVM_DIR="$(nvm_cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" >/dev/null && \pwd)" NVM_DIR="$(nvm_cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" >/dev/null && \pwd)"
@ -968,6 +969,7 @@ nvm_list_aliases() {
local ALIAS_NAME local ALIAS_NAME
for ALIAS_NAME in "$(nvm_node_prefix)" "stable" "unstable"; do for ALIAS_NAME in "$(nvm_node_prefix)" "stable" "unstable"; do
{ {
# shellcheck disable=SC2030,SC2031 # (https://github.com/koalaman/shellcheck/issues/2217)
if [ ! -f "${NVM_ALIAS_DIR}/${ALIAS_NAME}" ] && { [ -z "${ALIAS}" ] || [ "${ALIAS_NAME}" = "${ALIAS}" ]; }; then if [ ! -f "${NVM_ALIAS_DIR}/${ALIAS_NAME}" ] && { [ -z "${ALIAS}" ] || [ "${ALIAS_NAME}" = "${ALIAS}" ]; }; then
NVM_NO_COLORS="${NVM_NO_COLORS-}" NVM_CURRENT="${NVM_CURRENT}" nvm_print_default_alias "${ALIAS_NAME}" NVM_NO_COLORS="${NVM_NO_COLORS-}" NVM_CURRENT="${NVM_CURRENT}" nvm_print_default_alias "${ALIAS_NAME}"
fi fi
@ -975,6 +977,7 @@ nvm_list_aliases() {
done done
wait wait
ALIAS_NAME="$(nvm_iojs_prefix)" ALIAS_NAME="$(nvm_iojs_prefix)"
# shellcheck disable=SC2030,SC2031 # (https://github.com/koalaman/shellcheck/issues/2217)
if [ ! -f "${NVM_ALIAS_DIR}/${ALIAS_NAME}" ] && { [ -z "${ALIAS}" ] || [ "${ALIAS_NAME}" = "${ALIAS}" ]; }; then if [ ! -f "${NVM_ALIAS_DIR}/${ALIAS_NAME}" ] && { [ -z "${ALIAS}" ] || [ "${ALIAS_NAME}" = "${ALIAS}" ]; }; then
NVM_NO_COLORS="${NVM_NO_COLORS-}" NVM_CURRENT="${NVM_CURRENT}" nvm_print_default_alias "${ALIAS_NAME}" NVM_NO_COLORS="${NVM_NO_COLORS-}" NVM_CURRENT="${NVM_CURRENT}" nvm_print_default_alias "${ALIAS_NAME}"
fi fi
@ -982,6 +985,7 @@ nvm_list_aliases() {
( (
local LTS_ALIAS local LTS_ALIAS
# shellcheck disable=SC2030,SC2031 # (https://github.com/koalaman/shellcheck/issues/2217)
for ALIAS_PATH in "${NVM_ALIAS_DIR}/lts/${ALIAS}"*; do for ALIAS_PATH in "${NVM_ALIAS_DIR}/lts/${ALIAS}"*; do
{ {
LTS_ALIAS="$(NVM_NO_COLORS="${NVM_NO_COLORS-}" NVM_LTS=true nvm_print_alias_path "${NVM_ALIAS_DIR}" "${ALIAS_PATH}")" LTS_ALIAS="$(NVM_NO_COLORS="${NVM_NO_COLORS-}" NVM_LTS=true nvm_print_alias_path "${NVM_ALIAS_DIR}" "${ALIAS_PATH}")"
@ -2849,7 +2853,7 @@ nvm() {
nvm_err "\$TERM_PROGRAM: ${TERM_PROGRAM}" nvm_err "\$TERM_PROGRAM: ${TERM_PROGRAM}"
fi fi
nvm_err "\$SHELL: ${SHELL}" nvm_err "\$SHELL: ${SHELL}"
# shellcheck disable=SC2169 # shellcheck disable=SC2169,SC3028
nvm_err "\$SHLVL: ${SHLVL-}" nvm_err "\$SHLVL: ${SHLVL-}"
nvm_err "whoami: '$(whoami)'" nvm_err "whoami: '$(whoami)'"
nvm_err "\${HOME}: ${HOME}" nvm_err "\${HOME}: ${HOME}"