Created
December 11, 2018 23:13
-
-
Save KenG98/2d084a9859637cdd1614ba27485e2ef9 to your computer and use it in GitHub Desktop.
Putting NVM init into a function
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
# PUT THESE LINES | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
# INTO A FUNCTION | |
function initnvm { | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
} | |
# THEN RUN THE FUNCTION WHEN YOU NEED NVM | |
initnvm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment