mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 14:51:49 +00:00
Update README.md
Added another anchor to the table of content.
This commit is contained in:
parent
054d6957e7
commit
70954086e7
13
README.md
13
README.md
@ -21,7 +21,7 @@
|
|||||||
- [.nvmrc](#nvmrc)
|
- [.nvmrc](#nvmrc)
|
||||||
- [Deeper Shell Integration](#deeper-shell-integration)
|
- [Deeper Shell Integration](#deeper-shell-integration)
|
||||||
- [zsh](#zsh)
|
- [zsh](#zsh)
|
||||||
- [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)
|
- [bash](#bash)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
- [Running tests](#running-tests)
|
- [Running tests](#running-tests)
|
||||||
- [Bash completion](#bash-completion)
|
- [Bash completion](#bash-completion)
|
||||||
@ -351,10 +351,8 @@ If you prefer a lighter-weight solution, the recipes below have been contributed
|
|||||||
|
|
||||||
#### zsh
|
#### zsh
|
||||||
|
|
||||||
##### Calling `nvm use` automatically in a directory with a `.nvmrc` file
|
|
||||||
|
|
||||||
Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you enter a directory that contains an
|
Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you enter a directory that contains an
|
||||||
`.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!
|
# place this after nvm initialization!
|
||||||
@ -382,18 +380,13 @@ load-nvmrc
|
|||||||
|
|
||||||
#### bash
|
#### bash
|
||||||
|
|
||||||
##### Calling `nvm use` automatically in a directory with a `.nvmrc` file
|
|
||||||
|
|
||||||
Put this into your `$HOME/.bashrc` to call `nvm use` automatically whenever you enter a directory that contains an
|
Put this into your `$HOME/.bashrc` to call `nvm use` automatically whenever you enter a directory that contains an
|
||||||
`.nvmrc` file with a string telling nvm which node to `use`:
|
`.nvmrc` file with a string telling nvm which node to use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# place this after nvm initialization!
|
# place this after nvm initialization!
|
||||||
# Redefines the shells builtin cd as function to add a hook
|
|
||||||
cd() {
|
cd() {
|
||||||
# Calls the shells builtin to actually change the directory
|
|
||||||
builtin cd "$1"
|
builtin cd "$1"
|
||||||
# Tests for a non empty .nvmrc file and executes nvm use
|
|
||||||
[ -f ".nvmrc" ] && [ -s ".nvmrc" ] && nvm use
|
[ -f ".nvmrc" ] && [ -s ".nvmrc" ] && nvm use
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user