Added command nvm install stable
nvm auto-detects last stable relase and fetch it.
This commit is contained in:
parent
e6d1d0c4de
commit
b8ca75d15c
15
nvm.sh
15
nvm.sh
|
|
@ -54,7 +54,11 @@ nvm_version() {
|
|||
|
||||
nvm_remote_version() {
|
||||
local PATTERN=$1
|
||||
if [[ $PATTERN == "stable" ]]; then
|
||||
VERSION=`nvm_last_stable_version`
|
||||
else
|
||||
VERSION=`nvm_ls_remote $PATTERN | tail -n1`
|
||||
fi
|
||||
echo "$VERSION"
|
||||
|
||||
if [ "$VERSION" = 'N/A' ]; then
|
||||
|
|
@ -111,6 +115,17 @@ nvm_ls_remote() {
|
|||
return
|
||||
}
|
||||
|
||||
nvm_last_stable_version(){
|
||||
local VERSION
|
||||
VERSION=`curl http://nodejs.org/dist/latest/ | grep -o 'node-v.*\"' -m 1 | grep -o 'v[0-9]*\.[0-9]*\.[0-9]*'`
|
||||
if [ ! "$VERSION" ]; then
|
||||
echo "N/A"
|
||||
return
|
||||
fi
|
||||
echo "$VERSION"
|
||||
return
|
||||
}
|
||||
|
||||
nvm_checksum() {
|
||||
if [ "$1" = "$2" ]; then
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue