mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
Merge pull request #205 from deiga/add-current-command
Added command to get current nvm environment.
This commit is contained in:
commit
d7015c7f65
3
nvm.sh
3
nvm.sh
@ -441,6 +441,9 @@ nvm() {
|
||||
print_versions "`nvm_ls_remote $2`"
|
||||
return
|
||||
;;
|
||||
"current" )
|
||||
echo -ne "current: \t"; nvm_version current
|
||||
;;
|
||||
"alias" )
|
||||
mkdir -p $NVM_DIR/alias
|
||||
if [ $# -le 2 ]; then
|
||||
|
6
test/fast/Running "nvm current" should display current nvm environment.
Executable file
6
test/fast/Running "nvm current" should display current nvm environment.
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../nvm.sh
|
||||
[[ $(nvm current) == *"current"* ]] || die "Failed to find current version"
|
Loading…
Reference in New Issue
Block a user