Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. set -e
  4.  
  5. # Ensure we have the `hub` command available.
  6. if ! [[ -x "$(command -v hub)" ]]; then
  7. echo "Error: 'hub' is required"
  8. exit 1
  9. fi
  10.  
  11. # Loop through all subdirectories of the current directory that are Git repos
  12. for gitDir in $(ls -d ./*/.git)
  13. do
  14. parent=$(echo ${gitDir} | sed -E 's/\/.git\/?//')
  15. echo "running hub sync: hub --git-dir='${gitDir}' --work-tree='${parent}' sync"
  16. hub --git-dir="${gitDir}" --work-tree="${parent}" sync
  17. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement