-
-
Save Pelirrojo/bd05f024d485a16d88471809482554e8 to your computer and use it in GitHub Desktop.
Lazy Load Homebrew NVM but still have default aliased Node in PATH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://gist.github.com/gfguthrie/9f9e3908745694c81330c01111a9d642#gistcomment-3143229 | |
(...) | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" | |
DEFAULT_NODE_VER='default'; | |
while [ -s "$NVM_DIR/alias/$DEFAULT_NODE_VER" ]; do | |
DEFAULT_NODE_VER="$(<$NVM_DIR/alias/$DEFAULT_NODE_VER)" | |
done; | |
export PATH="$NVM_DIR/versions/node/v${DEFAULT_NODE_VER#v}/bin:$PATH" | |
alias nvm='unalias nvm; [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use; nvm' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment