commit
a987f8e67d
|
@ -27,6 +27,10 @@ And then in any new shell just use the installed version:
|
||||||
|
|
||||||
nvm use v0.4.1
|
nvm use v0.4.1
|
||||||
|
|
||||||
|
Or you can just run it:
|
||||||
|
|
||||||
|
nvm run v0.4.1
|
||||||
|
|
||||||
If you want to see what versions are available:
|
If you want to see what versions are available:
|
||||||
|
|
||||||
nvm ls
|
nvm ls
|
||||||
|
|
14
nvm.sh
14
nvm.sh
|
@ -188,6 +188,20 @@ nvm()
|
||||||
export NVM_BIN="$NVM_DIR/$VERSION/bin"
|
export NVM_BIN="$NVM_DIR/$VERSION/bin"
|
||||||
echo "Now using node $VERSION"
|
echo "Now using node $VERSION"
|
||||||
;;
|
;;
|
||||||
|
"run" )
|
||||||
|
# run given version of node
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
nvm help
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
VERSION=`nvm_version $2`
|
||||||
|
if [ ! -d $NVM_DIR/$VERSION ]; then
|
||||||
|
echo "$VERSION version is not installed yet"
|
||||||
|
return;
|
||||||
|
fi
|
||||||
|
echo "Running node $VERSION"
|
||||||
|
$NVM_DIR/$VERSION/bin/node "${@:3}"
|
||||||
|
;;
|
||||||
"ls" | "list" )
|
"ls" | "list" )
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
nvm_version $2
|
nvm_version $2
|
||||||
|
|
Loading…
Reference in New Issue