mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	zsh script: Check version / .nvmrc on new shell also.
This commit is contained in:
		| @@ -195,6 +195,7 @@ Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you e | |||||||
| `.nvmrc` file with a string telling nvm which node to `use`: | `.nvmrc` file with a string telling nvm which node to `use`: | ||||||
|  |  | ||||||
| ```zsh | ```zsh | ||||||
|  | # place this after nvm initialization! | ||||||
| autoload -U add-zsh-hook | autoload -U add-zsh-hook | ||||||
| load-nvmrc() { | load-nvmrc() { | ||||||
|   if [[ -f .nvmrc && -r .nvmrc ]]; then |   if [[ -f .nvmrc && -r .nvmrc ]]; then | ||||||
| @@ -205,6 +206,7 @@ load-nvmrc() { | |||||||
|   fi |   fi | ||||||
| } | } | ||||||
| add-zsh-hook chpwd load-nvmrc | add-zsh-hook chpwd load-nvmrc | ||||||
|  | load-nvmrc | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## License | ## License | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user