Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # This script executes action in each defined repo
  4.  
  5. basedir=${BASEDIR:-$HOME/repos}
  6. repos="sti-base sti-ruby sti-nodejs sti-python sti-php sti-perl mysql mongodb postgresql"
  7.  
  8. function do_action {
  9. local action_name="$1";shift
  10. case "$action_name" in
  11. list-pr)
  12. echo "$(basename `pwd`):"
  13. hub issue | grep --color=never pull
  14. ;;
  15. commit-all)
  16. echo "$(basename `pwd`):"
  17. git checkout -b $1
  18. git add .
  19. git commit -m "$2"
  20. ;;
  21. push-all)
  22. echo "$(basename `pwd`):"
  23. git push origin $1
  24. ;;
  25. pull-all)
  26. echo "$(basename `pwd`):"
  27. hub pull-request -i "$1" -m "$2"
  28. ;;
  29. *)
  30. echo "ERROR: unknown action ${action_name}"
  31. esac
  32. }
  33.  
  34. for d in $repos; do
  35. pushd "${basedir}/${d}" >/dev/null; do_action $@; popd >/dev/null
  36. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement