Last active
May 26, 2016 14:27
-
-
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.
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
# 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