Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. function install_node() {
  2. local REQUIRED_MAJOR_NODE_VERSION=${REQUIRED_NODEJS_VERSION:0:1}
  3. echo "${BLUE}Which version manager do you want to install node.js with? If you don't know, choose 'brew'${NORMAL}:"
  4. select NODE_VERSION_MANAGER in 'brew' 'nvm' 'nodenv' 'other';
  5. do
  6. case $NODE_VERSION_MANAGER in
  7. 'nvm'|'nodenv')
  8. verify_command $NODE_VERSION_MANAGER
  9. set +x
  10. $NODE_VERSION_MANAGER install $REQUIRED_MAJOR_NODE_VERSION
  11. set -x
  12. break
  13. ;;
  14. 'other')
  15. read -p "${BLUE}Please write the command of your node version manager: ${NORMAL}" -r
  16. local OTHER=$REPLY
  17. if ! command -v "$OTHER"; then
  18. echo "${RED}$OTHER does not exist.$NORMAL" >&2
  19. install_node_homebrew
  20. else
  21. ${OTHER} install $REQUIRED_MAJOR_NODE_VERSION
  22. fi
  23. break
  24. ;;
  25. 'brew'|*)
  26. install_node_homebrew
  27. break
  28. ;;
  29. esac
  30. done
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement