Finds NVM_DIR without using cd

Using `cd` makes the nvm directory the number-one directory in `autojump`'s database---which is somewhat confusing since the user basically never `cd`s to it directly!---so here's an alternative method that doesn't use the `cd` command. I've checked it works in both Bash and Zsh.
master
00Davo 2013-09-18 17:10:24 +10:00
parent e58c495f69
commit 1ad9d18257
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -9,7 +9,7 @@
# Auto detect the NVM_DIR # Auto detect the NVM_DIR
if [ ! -d "$NVM_DIR" ]; then if [ ! -d "$NVM_DIR" ]; then
export NVM_DIR=$(cd $(dirname ${BASH_SOURCE[0]:-$0}) > /dev/null && pwd) export NVM_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]:-$0}))
fi fi
# Make zsh glob matching behave same as bash # Make zsh glob matching behave same as bash