`nvm alias`: add `lts/` support.

Jordan Harband 2016-04-26 23:07:22 -07:00
parent 9bd743e0be
commit 17c9bef4aa
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 9 additions and 1 deletions

10
nvm.sh
View File

@ -2558,7 +2558,7 @@ $NVM_LS_REMOTE_POST_MERGED_OUTPUT" | nvm_grep -v "N/A" | command sed '/^$/d')"
"alias" )
local NVM_ALIAS_DIR
NVM_ALIAS_DIR="$(nvm_alias_path)"
command mkdir -p "$NVM_ALIAS_DIR"
command mkdir -p "$NVM_ALIAS_DIR/lts"
local NVM_CURRENT
NVM_CURRENT="$(nvm_ls_current)"
if [ $# -le 2 ]; then
@ -2573,6 +2573,14 @@ $NVM_LS_REMOTE_POST_MERGED_OUTPUT" | nvm_grep -v "N/A" | command sed '/^$/d')"
NVM_CURRENT="${NVM_CURRENT}" nvm_print_default_alias "$ALIAS"
fi
done
local LTS_ALIAS
for ALIAS_PATH in "$NVM_ALIAS_DIR/lts/${2-}"*; do
LTS_ALIAS="$(nvm_print_alias_path "$NVM_ALIAS_DIR" "$ALIAS_PATH")"
if [ -n "$LTS_ALIAS" ]; then
nvm_echo "${LTS_ALIAS-}"
fi
done
return
fi
if [ -z "${3-}" ]; then