zsh-nvm icon indicating copy to clipboard operation
zsh-nvm copied to clipboard

Add the ability to exclude specific cases from NVM_AUTO_USE

Open henderea opened this issue 4 years ago • 0 comments

A git repo I have checked out locally recently added a .nvmrc with version 13.8.0. I don't have that version installed, so every time I enter that directory, it starts trying to install 13.8.0, which I have to quickly cancel every time since there's no reason to install 13.8.0 when it is outdated but not LTS.

This PR adds support for the array environment variables NVM_AUTO_USE_IGNORE_VERSION and NVM_AUTO_USE_IGNORE_PATH. These are used to ignore specific values from .nvmrc and to ignore the .nvmrc in specific directories.

Examples (in ~/.zshrc):

export NVM_AUTO_USE_IGNORE_VERSION=("v13.8.0" "lts/boron")

Auto-use will be skipped if the .nvmrc file it finds contains the values v13.8.0 or lts/boron.

export NVM_AUTO_USE_IGNORE_PATH=("$HOME/projects/annoying-external-repo")

Auto-use will be skipped if the .nvmrc file it finds is $HOME/projects/annoying-external-repo/.nvmrc.

henderea avatar Apr 21 '20 16:04 henderea