diff --git a/files/bin/repo-list b/files/bin/repo-list new file mode 100755 index 0000000..4523455 --- /dev/null +++ b/files/bin/repo-list @@ -0,0 +1,23 @@ +#!/bin/sh + +DEPTH=${1:-4} + +set -eu +ls_r() { + local count="$1" base="$2" + local x= d= + shift 2 + + let count-- || return + + [ ! -e "$base/.git" ] || echo "${base#./}" + + for d in "$base"/*; do + if [ -d "$d" ]; then + ls_r $count "$d" & + fi + done + wait +} + +ls_r "$DEPTH" .