Managing git pull mesages

This commit is contained in:
antoine 2024-06-24 10:03:17 -10:00
parent 1eb6bba53b
commit 2561a9ce85

View File

@ -32,15 +32,26 @@ PROGRESS_BAR_DISPLAY_COMPL=1
puller() { puller() {
SECONDS=0 SECONDS=0
i=1 i=1
reporting=false
report=$'============================\nPulling generated messages :\n============================\n'
for repo in ${REPOS[@]}; do for repo in ${REPOS[@]}; do
run_error=""
echo $repo $i echo $repo $i
git -C $repo/.. pull > /dev/null run_error=$(git -C $repo/.. pull 2>&1 > /dev/null)
if [[ $run_error ]]; then
reporting=true
report=$report$"* On $repo :"$'\n'"$run_error"$'\n'
fi
((i++)) ((i++))
done done
duration=$SECONDS duration=$SECONDS
((i--)) ((i--))
echo "[Finished] - Pulled $i/$PULL_ITER repositories in $((duration / 60)):$((duration % 60))" echo "[Finished] - Pulled $i/$PULL_ITER repositories in $((duration / 60)):$((duration % 60))"
if [ "$reporting" = true ]; then
echo "$report"
fi
} }
draw_progressbar() { draw_progressbar() {
@ -95,7 +106,7 @@ parse_output() {
"$iteration" \ "$iteration" \
"$PULL_ITER" \ "$PULL_ITER" \
"$info" "$info"
elif [[ "$line" =~ Finished ]]; then else
printf >&2 "\033[0K\r" printf >&2 "\033[0K\r"
printf "%s\n" "$line" printf "%s\n" "$line"
fi fi