Created
January 10, 2017 23:16
-
-
Save DanielHeath/ccd5d6089a68a861240de873ca4b3c8c to your computer and use it in GitHub Desktop.
How I source nvm (because it's slow
This file contains hidden or 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
#!/usr/bin/env bash | |
export NVM_DIR="$HOME/.nvm" | |
function _source_nvm() { | |
if [ -z "$NVM_PATH" ] ; then | |
# Prevent infinite recursion | |
unset -f nvm; | |
unset -f npm; | |
unset -f grunt; | |
. /usr/local/opt/nvm/nvm.sh; | |
fi | |
} | |
function nvm() { | |
_source_nvm | |
nvm "$@" | |
} | |
function grunt() { | |
_source_nvm | |
grunt "$@" | |
} | |
function npm() { | |
_source_nvm | |
npm "$@" | |
} | |
alias grunt="grunt --stack" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment