add nvm script for use by other shells

This commit is contained in:
Daniel Bretoi 2014-11-21 13:11:49 -08:00
parent afba4e08fd
commit 452fbd5162
2 changed files with 24 additions and 0 deletions

View File

@ -98,6 +98,19 @@ To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`:
`nvm use` will not, by default, create a "current" symlink. Set `$NVM_SYMLINK_CURRENT` to "true" to enable this behavior, which is sometimes useful for IDEs. `nvm use` will not, by default, create a "current" symlink. Set `$NVM_SYMLINK_CURRENT` to "true" to enable this behavior, which is sometimes useful for IDEs.
## Other shells
You can run nvm from other shells by using the script provided in the bin
directory. It must remain relative to the install.
Add `<prefix>/bin` and `<prefix>/current/bin` to your PATH and use nvm transparantly.
### Example [fish-shell](http://fishshell.com/) config:
Where nvm is installed at `~/.nvm`
set -x fish_user_paths $PATH $HOME/.nvm/current/bin $HOME/.nvm/bin
## License ## License
nvm is released under the MIT license. nvm is released under the MIT license.

11
bin/nvm Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# For non bash-shells (fish, etc)
# add <prefix>/nvm/bin and <prefix>/nvm/current/bin to PATH
export NVM_SYMLINK_CURRENT=true
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/../nvm.sh;
nvm $@