Created
July 16, 2024 21:01
-
-
Save vispar-tech/8abc7e78c880d1e9af1f9a4a831a3fe0 to your computer and use it in GitHub Desktop.
Сhecks that the folder name matches the git origin of the project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for dir in $(find . -type d -name ".git"); do | |
repo_dir=$(dirname "$dir") | |
repo_name=$(basename "$repo_dir") | |
remote_url=$(cd "$repo_dir" && git remote get-url origin) | |
remote_repo_name=$(basename "$remote_url" .git) | |
if [ "$repo_name" != "$remote_repo_name" ]; then | |
echo "$repo_dir - $remote_url" | |
else | |
echo "$repo_dir - Is okay"; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment