-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add nvm script for use by other shells #582
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
## 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this use |
||
|
||
## License | ||
|
||
nvm is released under the MIT license. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# For non bash-shells (fish, etc) | ||
# add <prefix>/nvm/bin and <prefix>/nvm/current/bin to PATH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be part of the install script as well? |
||
|
||
export NVM_SYMLINK_CURRENT=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Must this env var be forced to true, for this script to work, rather than just using the environment setting? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, but the script uses about 90% of it's value without it. Basically you'd be forced to add something to your environmental settings which can just as easily be done here saving the work. |
||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source ${DIR}/../nvm.sh; | ||
|
||
nvm $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If using the symlink isn't required, but rather just an extra alternative, then could the symlink instructions be grouped in their own separate section?