[shellcheck] Declare and assign separately to avoid masking return values

https://github.com/koalaman/shellcheck/wiki/SC2155
Jordan Harband 2015-10-12 16:02:35 -07:00
parent c957989fa9
commit bf284203cb
1 changed files with 2 additions and 1 deletions

3
nvm.sh
View File

@ -78,7 +78,8 @@ if [ -z "$NVM_DIR" ]; then
if [ -n "$BASH_SOURCE" ]; then
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
fi
export 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
fi
unset NVM_SCRIPT_SOURCE 2> /dev/null