[shellcheck] disable "Check exit code directly" warning on line 273, 666

We need to use both the exit state and result form the previous commit,
so SC2181 should be disabled here.
Peter Dave Hello 2016-11-23 21:44:35 +08:00
parent 5508f8dc70
commit 4b4e71f05c
1 changed files with 2 additions and 0 deletions

2
nvm.sh
View File

@ -269,6 +269,7 @@ nvm_ensure_version_installed() {
local NVM_VERSION_DIR local NVM_VERSION_DIR
if [ "${EXIT_CODE}" != "0" ] || ! nvm_is_version_installed "${LOCAL_VERSION}"; then if [ "${EXIT_CODE}" != "0" ] || ! nvm_is_version_installed "${LOCAL_VERSION}"; then
VERSION="$(nvm_resolve_alias "${PROVIDED_VERSION}")" VERSION="$(nvm_resolve_alias "${PROVIDED_VERSION}")"
# shellcheck disable=SC2181
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
nvm_err "N/A: version \"${PROVIDED_VERSION} -> ${VERSION}\" is not yet installed." nvm_err "N/A: version \"${PROVIDED_VERSION} -> ${VERSION}\" is not yet installed."
nvm_err "" nvm_err ""
@ -663,6 +664,7 @@ nvm_alias() {
nvm_ls_current() { nvm_ls_current() {
local NVM_LS_CURRENT_NODE_PATH local NVM_LS_CURRENT_NODE_PATH
NVM_LS_CURRENT_NODE_PATH="$(command which node 2> /dev/null)" NVM_LS_CURRENT_NODE_PATH="$(command which node 2> /dev/null)"
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
nvm_echo 'none' nvm_echo 'none'
elif nvm_tree_contains_path "$(nvm_version_dir iojs)" "${NVM_LS_CURRENT_NODE_PATH}"; then elif nvm_tree_contains_path "$(nvm_version_dir iojs)" "${NVM_LS_CURRENT_NODE_PATH}"; then