mirror of
https://github.com/GRFreire/dotfiles.git
synced 2026-01-10 04:19:38 +00:00
fast-nvm: no need to sort function output
This commit is contained in:
parent
9014ff7043
commit
bfeef18cf4
@ -5,19 +5,15 @@ list_nvmrc_recursive() {
|
||||
if [ "$DIR" != "/" ]; then list_nvmrc_recursive "$PARENT_DIR"; fi;
|
||||
}
|
||||
|
||||
list_nvmrc() {
|
||||
list_nvmrc_recursive . | sort
|
||||
}
|
||||
|
||||
export PATH="$HOME/.nvm/versions/node/$(/bin/cat $HOME/.nvm/alias/default)/bin:$PATH"
|
||||
nvm() {
|
||||
. $HOME/.nvm/nvm.sh; nvm "$@"
|
||||
}
|
||||
|
||||
DEFAULT=$(list_nvmrc)
|
||||
DEFAULT=$(list_nvmrc_recursive .)
|
||||
cd() {
|
||||
if builtin cd "$@" 2>/dev/null; then
|
||||
FOUND="$(list_nvmrc)"
|
||||
FOUND="$(list_nvmrc_recursive .)"
|
||||
if [ "$FOUND" != "" ] && [ "$DEFAULT" != "$FOUND" ]; then
|
||||
DEFAULT=$FOUND
|
||||
nvm use
|
||||
|
||||
Loading…
Reference in New Issue
Block a user