Browse Source

`nvm_strip_path`: Error out when `$NVM_DIR` is not set.

Per https://github.com/creationix/nvm/issues/1083#issuecomment-217752185
Jordan Harband 9 years ago
parent
commit
0880539972
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
  1. 4
      nvm.sh

4
nvm.sh

@ -403,6 +403,10 @@ nvm_num_version_groups() { @@ -403,6 +403,10 @@ nvm_num_version_groups() {
}
nvm_strip_path() {
if [ -z "${NVM_DIR-}" ]; then
nvm_err '$NVM_DIR not set!'
return 1
fi
nvm_echo "$1" | command sed \
-e "s#$NVM_DIR/[^/]*$2[^:]*:##g" \
-e "s#:$NVM_DIR/[^/]*$2[^:]*##g" \

Loading…
Cancel
Save