commit eca45b646f5778f9b46a4e368851698543df487d
parent 1cf8cea074471577f784756fb1ca1f5ce9449432
Author: Byron Torres <b@torresjrjr.com>
Date: Fri, 7 Apr 2023 17:23:19 +0100
gfa*: fix error return, add maxdepth arg
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/bin/gfa b/bin/gfa
@@ -27,6 +27,8 @@ worker() {
git fetch -q 2>&- || {
println $n $width 31 "$?"
+ env printf '\n' >/tmp/gfa-done
+ env printf '\n' >/tmp/gfa-finis
return
}
@@ -55,8 +57,12 @@ worker() {
}
+maxdepth=${1:-3}
+winsz=16
+lines=0
+
cwd=$( pwd )
-repos=$( find -maxdepth 3 -path '*/.git' -not -path '*/_*' | sort )
+repos=$( find -maxdepth "$maxdepth" -path '*/.git' -not -path '*/_*' | sort )
[ "$repos" ] || printf >&2 'No git repos here\n'
@@ -69,9 +75,6 @@ touch /tmp/gfa-lines
touch /tmp/gfa-mutex
mkfifo /tmp/gfa-inits /tmp/gfa-finis /tmp/gfa-done
-winsz=32
-lines=0
-
env printf '[fetching %s repos]\n' "$total"
for dir in $repos