Skip to content

Instantly share code, notes, and snippets.

@keichan34
Last active May 26, 2016 14:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keichan34/e4389e7db547f1b5bfae8d9333f951b8 to your computer and use it in GitHub Desktop.
Save keichan34/e4389e7db547f1b5bfae8d9333f951b8 to your computer and use it in GitHub Desktop.
I got tired of loading nvm every time in my fish shell, so this.
# Requires bass and nvm
# bass: https://github.com/edc/bass
# nvm: https://github.com/creationix/nvm
function nvm
set -g NVM_LOADED "1"
bass source ~/.nvm/nvm.sh ';' nvm $argv
end
function ensure_nvm_loaded
if [ "$NVM_LOADED" != "1" ]
set_color green
echo "Loading nvm..."
set_color normal
nvm > /dev/null
end
end
function node
ensure_nvm_loaded
command node $argv
end
function npm
ensure_nvm_loaded
command npm $argv
end
function ember
ensure_nvm_loaded
command ember $argv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment