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
parent
e58c495f69
commit
1ad9d18257
2
nvm.sh
2
nvm.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue