]> git.phdru.name Git - git-scripts.git/blob - run-bare-repos
Feat(submodules/remove): Add option `-c`
[git-scripts.git] / run-bare-repos
1 #! /bin/sh
2
3 cd "`dirname \"$0\"`" &&
4 prog_dir="`pwd`" &&
5 export prog_dir
6
7 if [ "$1" = "-v" ]; then
8    verbose=1
9    shift
10 fi
11
12 cat "$prog_dir"/locate-all.list |
13 while read d; do
14    if ! test -d "$d"; then echo "No such dir: $d" >&2; continue; fi
15    if test -d "$d/.git"; then continue; fi # Skip non-bare repos
16    if [ "$verbose" = 1 ]; then echo "$d"; fi
17    cd "$d" && "$@" < /dev/tty || exit 1
18 done