Skip to content

Instantly share code, notes, and snippets.

@kuanyui
Created October 17, 2022 02:36
Show Gist options
  • Save kuanyui/9e7dbfa9542b360ad78ac0326bdfdfb6 to your computer and use it in GitHub Desktop.
Save kuanyui/9e7dbfa9542b360ad78ac0326bdfdfb6 to your computer and use it in GitHub Desktop.
Auto use nvm & gvm in Makefile
.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