[shellcheck] Use -n/-z instead of ! -z/! -n condition

https://github.com/koalaman/shellcheck/wiki/SC2236
This commit is contained in:
Peter Dave Hello
2018-12-03 13:59:19 +08:00
committed by Jordan Harband
parent 153506c8da
commit 14179bc8ce
2 changed files with 5 additions and 5 deletions

2
nvm.sh
View File

@@ -323,7 +323,7 @@ nvm_rc_version() {
return 1
fi
NVM_RC_VERSION="$(command head -n 1 "${NVMRC_PATH}" | command tr -d '\r')" || command printf ''
if [ ! -n "${NVM_RC_VERSION}" ]; then
if [ -z "${NVM_RC_VERSION}" ]; then
nvm_err "Warning: empty .nvmrc file found at \"${NVMRC_PATH}\""
return 2
fi