Browse Source

repo-list: searches for git trees

similar to `repo list -p` when using .repo

Signed-off-by: Alejandro Mery <amery@geeks.cl>
master
Alejandro Mery 9 years ago
parent
commit
3bbf502762
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      files/bin/repo-list

+ 23
- 0
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" .

Loading…
Cancel
Save