Browse Source

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 12 years ago
parent
commit
1ad9d18257
  1. 2
      nvm.sh

2
nvm.sh

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
# Auto detect the NVM_DIR
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
# Make zsh glob matching behave same as bash

Loading…
Cancel
Save