[Refactor] avoid S2181 spellcheck error.
parent
af73102481
commit
5b820a453c
16
nvm.sh
16
nvm.sh
|
@ -268,9 +268,7 @@ nvm_ensure_version_installed() {
|
||||||
EXIT_CODE="$?"
|
EXIT_CODE="$?"
|
||||||
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}")"
|
if VERSION="$(nvm_resolve_alias "${PROVIDED_VERSION}")"; then
|
||||||
# shellcheck disable=SC2181
|
|
||||||
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 ""
|
||||||
nvm_err "You need to run \"nvm install ${PROVIDED_VERSION}\" to install it before using it."
|
nvm_err "You need to run \"nvm install ${PROVIDED_VERSION}\" to install it before using it."
|
||||||
|
@ -663,9 +661,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)"
|
if ! NVM_LS_CURRENT_NODE_PATH="$(command which node 2> /dev/null)"; then
|
||||||
# shellcheck disable=SC2181
|
|
||||||
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
|
||||||
nvm_add_iojs_prefix "$(iojs --version 2>/dev/null)"
|
nvm_add_iojs_prefix "$(iojs --version 2>/dev/null)"
|
||||||
|
@ -1467,12 +1463,10 @@ nvm_get_arch() {
|
||||||
# isainfo to get the instruction set supported by the
|
# isainfo to get the instruction set supported by the
|
||||||
# kernel.
|
# kernel.
|
||||||
if [ "_$NVM_OS" = "_sunos" ]; then
|
if [ "_$NVM_OS" = "_sunos" ]; then
|
||||||
HOST_ARCH=$(pkg_info -Q MACHINE_ARCH pkg_install)
|
if HOST_ARCH=$(pkg_info -Q MACHINE_ARCH pkg_install); then
|
||||||
EXIT_CODE=$?
|
HOST_ARCH=$(echo "${HOST_ARCH}" | command tail -1)
|
||||||
if [ $EXIT_CODE -ne 0 ]; then
|
|
||||||
HOST_ARCH=$(isainfo -n)
|
|
||||||
else
|
else
|
||||||
HOST_ARCH=$(echo "$HOST_ARCH" | command tail -1)
|
HOST_ARCH=$(isainfo -n)
|
||||||
fi
|
fi
|
||||||
elif [ "_$NVM_OS" = "_aix" ]; then
|
elif [ "_$NVM_OS" = "_aix" ]; then
|
||||||
HOST_ARCH=ppc64
|
HOST_ARCH=ppc64
|
||||||
|
|
Loading…
Reference in New Issue