`nvm_strip_path`: Error out when `$NVM_DIR` is not set.
Per https://github.com/creationix/nvm/issues/1083#issuecomment-217752185
parent
6311a0e9c4
commit
0880539972
4
nvm.sh
4
nvm.sh
|
@ -403,6 +403,10 @@ nvm_num_version_groups() {
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_strip_path() {
|
nvm_strip_path() {
|
||||||
|
if [ -z "${NVM_DIR-}" ]; then
|
||||||
|
nvm_err '$NVM_DIR not set!'
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
nvm_echo "$1" | command sed \
|
nvm_echo "$1" | command sed \
|
||||||
-e "s#$NVM_DIR/[^/]*$2[^:]*:##g" \
|
-e "s#$NVM_DIR/[^/]*$2[^:]*:##g" \
|
||||||
-e "s#:$NVM_DIR/[^/]*$2[^:]*##g" \
|
-e "s#:$NVM_DIR/[^/]*$2[^:]*##g" \
|
||||||
|
|
Loading…
Reference in New Issue