Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for dir in */ ; do
- echo -ne "$dir \t "
- git -C "$dir" rev-parse &> /dev/null
- CODE=$?
- if [[ "$CODE" -eq "0" ]]; then
- echo -ne "is a git repository "
- git -C "$dir" remote get-url origin &> /dev/null
- CODE=$?
- if [[ "$CODE" -eq "0" ]]; then
- ORIGIN_URL=$(git -C "$dir" remote get-url origin)
- echo -e "with origin at \t $ORIGIN_URL"
- else
- echo -e "with NO origin"
- fi
- else
- echo "is NOT a git repository"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement