git-updater/update.sh

22 lines
432 B
Bash
Executable file

#!/bin/bash
source progress_info.sh
for rep in *
do
progress_start "\e[1;37m$rep\e[0m"
[[ ! -d $rep/.git ]] && {
progress_end "SKIP" blue
continue
}
cd $rep
output=$(git pull 2>&1) \
&& progress_end " OK " green "$(echo -e "\e[1;37m$rep\e[0m\n$output" | sed 'N;s/\n/\n /g;P;D')" \
|| progress_end "FAIL" red "$(echo -e "\e[1;37m$rep\e[0m\n$output" | sed 'N;s/\n/\n /g;P;D')"
cd - &>/dev/null
done