Merge pull request #205 from deiga/add-current-command

Added command to get current nvm environment.
master
Jordan Harband 2013-12-16 23:39:23 -08:00
commit d7015c7f65
2 changed files with 9 additions and 0 deletions

3
nvm.sh
View File

@ -441,6 +441,9 @@ nvm() {
print_versions "`nvm_ls_remote $2`" print_versions "`nvm_ls_remote $2`"
return return
;; ;;
"current" )
echo -ne "current: \t"; nvm_version current
;;
"alias" ) "alias" )
mkdir -p $NVM_DIR/alias mkdir -p $NVM_DIR/alias
if [ $# -le 2 ]; then if [ $# -le 2 ]; then

View File

@ -0,0 +1,6 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../nvm.sh
[[ $(nvm current) == *"current"* ]] || die "Failed to find current version"