Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. current_branch=$(git rev-parse --abbrev-ref HEAD)
  4. branches=( "master" "target/cloud" "target/stage" "target/hybrid" )
  5.  
  6. exec < /dev/tty
  7.  
  8. for branch in "${branches[@]}"
  9. do
  10. if [ $current_branch == $branch ]; then
  11. echo "Have you modified the version number? (y/n) "
  12. read -p "> " confirmation
  13. if [ $confirmation != "y" ]; then
  14. echo "Aborting push"
  15. exit 1
  16. fi
  17. echo "Pushing to $current_branch"
  18. fi
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement