err() { printf '%b\n' "$*" 1>&2; exit 1; }
vr() { echo "$@"; "$@"; }
+case $1 in
+-x) set -x; shift;;
+esac
+
case $1 in
""|-*) ;;
l)
while read -a line ; do
dir=${line[0]}
proj=${line[2]}
- cd "${root}/${dir}"
+ if ! cd "${root}/${dir}" ; then
+ echo "bad ${proj}"
+ continue
+ fi
(
out=$(env _proj=${proj} r rb all . 2>&1)
if [[ -n ${out} ]] ; then
printf '%s### %s%-40s%s: %s\n' \
"${BRACKET}" "${GOOD}" "${line%%:*}" "${NORMAL}" "${line#*:}"
else
- echo "${line}"
+ printf '%s### %s%-40s%s: ERROR: %s\n' \
+ "${BRACKET}" "${BAD}" "${dir}" "${NORMAL}" "${line}"
fi
done < <(echo "${out}")
fi
{
if ($0 ~ "^[*] *[(]no branch[)]") {
next
- } else if ($0 ~ "^[*] *[(]detached from ") {
+ } else if ($0 ~ "^[*] *[(](HEAD )?detached (from|at) ") {
next
} else if ($1 == "*") {
b = $2