Advertisement
Guest User

Untitled

a guest
May 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. function check_for_valid_npm () {
  2. # If NPM is not found, this will return 126 - Command invoked cannot execute
  3. npm --version >> /dev/null
  4. return $?
  5. }
  6.  
  7. function fetchbase () {
  8. git checkout master && git fetch upstream && git rebase upstream/master && git push origin master;
  9.  
  10. if [[ -a ./Gemfile ]]
  11. then
  12. read -q "RUN_BUNDLE_INSTALL?Run bundle install (y/n)?"
  13. if [ "$RUN_BUNDLE_INSTALL" == "y" ]
  14. then bundle install
  15. fi
  16. fi
  17. if [[ -a ./package.json ]]
  18. then
  19. if [[ -a ./yarn.lock ]]
  20. then
  21. read -q "RUN_YARN_INSTALL?Run yarn install (y/n)?"
  22. if [ "$RUN_YARN_INSTALL" == "y" ]
  23. then yarn install
  24. fi
  25. else
  26. if check_for_valid_npm == 0
  27. then npm install
  28. else nvm use stable && npm install
  29. fi
  30. fi
  31. fi
  32. if [[ -a ./pom.xml ]]
  33. then
  34. read -q "RUN_MVN_PACKAGE?Run mvn clean package (y/n)?"
  35. if [ "$RUN_MVN_PACKAGE" == "y" ]
  36. then mvn clean package
  37. fi
  38. fi
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement