Skip to content

Instantly share code, notes, and snippets.

@DanielHeath
Created January 10, 2017 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielHeath/ccd5d6089a68a861240de873ca4b3c8c to your computer and use it in GitHub Desktop.
Save DanielHeath/ccd5d6089a68a861240de873ca4b3c8c to your computer and use it in GitHub Desktop.
How I source nvm (because it's slow
#!/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