Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/bin/bash
  2. for dir in */ ; do
  3. echo -ne "$dir \t "
  4. git -C "$dir" rev-parse &> /dev/null
  5. CODE=$?
  6. if [[ "$CODE" -eq "0" ]]; then
  7. echo -ne "is a git repository "
  8. git -C "$dir" remote get-url origin &> /dev/null
  9. CODE=$?
  10. if [[ "$CODE" -eq "0" ]]; then
  11. ORIGIN_URL=$(git -C "$dir" remote get-url origin)
  12. echo -e "with origin at \t $ORIGIN_URL"
  13. else
  14. echo -e "with NO origin"
  15. fi
  16. else
  17. echo "is NOT a git repository"
  18. fi
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement