Created
October 17, 2022 02:36
-
-
Save kuanyui/9e7dbfa9542b360ad78ac0326bdfdfb6 to your computer and use it in GitHub Desktop.
Auto use nvm & gvm in Makefile
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
.ONESHELL: # This ".ONESHELL" is important! | |
define GVM_USE | |
echo "=========================================================================================" | |
echo "[INFO] Recommended Go Version: 1.9" | |
source "${GVM_ROOT}/scripts/gvm" # Or source "${HOME}/.gvm/scripts/gvm" | |
gvm use go1.9 | |
echo "[INFO] Remember to git checkout in ~/.gvm/pkgsets/go1.9/global/src/github.com/........" | |
echo "=========================================================================================" | |
endef | |
define NVM_USE | |
echo "=========================================================================================" | |
echo "[INFO] Recommended Node Version: 10.x (or 10.16.0)" | |
source ~/.nvm/nvm.sh | |
nvm use v10 | |
echo "=========================================================================================" | |
endef | |
default: | |
-$(NVM_USE) | |
-$(GVM_USE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment