1
0

add error overview to rgit util

This commit is contained in:
2023-07-03 14:19:40 +02:00
parent 860b89d598
commit 65615e0fe9

View File

@@ -2,8 +2,11 @@
bold=$(tput bold) bold=$(tput bold)
normal=$(tput sgr0) normal=$(tput sgr0)
red=$(tput setaf 1)
find -mindepth 1 -maxdepth 1 -type d | sort | while read file; do export repos_with_error=()
while read file; do
git -C "$file" rev-parse &> /dev/null git -C "$file" rev-parse &> /dev/null
code=$? code=$?
@@ -13,7 +16,16 @@ find -mindepth 1 -maxdepth 1 -type d | sort | while read file; do
if (( "$#" > 0 )); then if (( "$#" > 0 )); then
git -C "$file" "$@" git -C "$file" "$@"
if [ $? != 0 ]; then
repos_with_error+=("$repo")
fi
fi fi
fi fi
done < <(find -mindepth 1 -maxdepth 1 -type d | sort)
done if [ ${#repos_with_error[@]} != 0 ]; then
echo -e "\n${bold}${red}Fehler in folgenden Verzeichnissen:${normal}"
for repo in "${repos_with_error[@]}"; do
echo " - ${red}${repo}${normal}"
done
fi