mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-06-27 11:38:43 +00:00
try to use realpath to find nvm's dir
This commit is contained in:
parent
853afbf595
commit
af276b80fe
10
nvm-exec
10
nvm-exec
@ -1,6 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
function find_nvm_dir() {
|
||||||
|
if which realpath >& /dev/null; then
|
||||||
|
dirname "$(realpath "$0")"
|
||||||
|
else
|
||||||
|
command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
DIR="$(find_nvm_dir)"
|
||||||
|
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
\. "$DIR/nvm.sh" --no-use
|
\. "$DIR/nvm.sh" --no-use
|
||||||
|
Loading…
Reference in New Issue
Block a user