From c0d1785b8a5564edcf3bcd38446ef6d327fd5153 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 17 Apr 2020 18:41:21 +0300 Subject: [PATCH] Add `run-bare-repos`: run a command over all bare repositories --- run-bare-repos | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 run-bare-repos diff --git a/run-bare-repos b/run-bare-repos new file mode 100755 index 0000000..9f667ce --- /dev/null +++ b/run-bare-repos @@ -0,0 +1,18 @@ +#! /bin/sh + +cd "`dirname \"$0\"`" && +prog_dir="`pwd`" && +export prog_dir + +if [ "$1" = "-v" ]; then + verbose=1 + shift +fi + +cat "$prog_dir"/locate-all.list | +while read d; do + if ! test -d "$d"; then echo "No such dir: $d" >&2; continue; fi + if test -d "$d/.git"; then continue; fi # Skip non-bare repos + if [ "$verbose" = 1 ]; then echo "$d"; fi + cd "$d" && "$@" < /dev/tty || exit 1 +done -- 2.39.2