Add test for NVM_DIR outside nvm.sh

Fix symlink traversal
This commit is contained in:
Matt Saladna
2018-06-21 16:38:15 -04:00
parent d956279e5a
commit ad4fa37deb
2 changed files with 20 additions and 1 deletions

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env bash
SOURCE=${BASH_SOURCE[0]}
test -L "$SOURCE" && SOURCE=$(readlink "$SOURCE")
test -L "$SOURCE" && command cd "$( dirname "$SOURCE" )" && \
SOURCE=$(readlink "$SOURCE")
DIR="$(command cd "$( dirname "$SOURCE" )" && pwd )"
unset NVM_CD_FLAGS