From 452fbd5162cf41760c814f24bb79de5b14f21d99 Mon Sep 17 00:00:00 2001 From: Daniel Bretoi Date: Fri, 21 Nov 2014 13:11:49 -0800 Subject: [PATCH] add nvm script for use by other shells --- README.markdown | 13 +++++++++++++ bin/nvm | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100755 bin/nvm diff --git a/README.markdown b/README.markdown index bdf9007..669be3b 100644 --- a/README.markdown +++ b/README.markdown @@ -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 `/bin` and `/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 nvm is released under the MIT license. diff --git a/bin/nvm b/bin/nvm new file mode 100755 index 0000000..33b0465 --- /dev/null +++ b/bin/nvm @@ -0,0 +1,11 @@ +#!/bin/bash + +# For non bash-shells (fish, etc) +# add /nvm/bin and /nvm/current/bin to PATH + +export NVM_SYMLINK_CURRENT=true + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source ${DIR}/../nvm.sh; + +nvm $@