diff --git a/gitpuller.sh b/gitpuller.sh index 9e020b4..43b897d 100644 --- a/gitpuller.sh +++ b/gitpuller.sh @@ -32,15 +32,26 @@ PROGRESS_BAR_DISPLAY_COMPL=1 puller() { SECONDS=0 i=1 + reporting=false + report=$'============================\nPulling generated messages :\n============================\n' for repo in ${REPOS[@]}; do + run_error="" 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++)) done duration=$SECONDS ((i--)) echo "[Finished] - Pulled $i/$PULL_ITER repositories in $((duration / 60)):$((duration % 60))" + + if [ "$reporting" = true ]; then + echo "$report" + fi } draw_progressbar() { @@ -95,7 +106,7 @@ parse_output() { "$iteration" \ "$PULL_ITER" \ "$info" - elif [[ "$line" =~ Finished ]]; then + else printf >&2 "\033[0K\r" printf "%s\n" "$line" fi