# Finds and verifies signatures of git repositories in specified dir
# Usage: bk-find-git-verify [DIR]
# Depends: GNU parallel 20210822, sort (GNU coreutils) 8.32
-# Version: 0.0.1
+# Version: 0.0.2
+
+# global vars
+findMaxDepth=8;
# Define functions
yell() { echo "$0: $*" >&2; } # print script path and all args to stderr
if [[ ! -d "$1" ]]; then die "FATAL:Not a dir:$1"; fi;
# Get list of dirs containing '.git' directory
- dir_list="$(find "$1" -type d -name ".git" 2>/dev/random | parallel dirname '{}' | sort -u)";
+ dir_list="$(find -L "$1" -maxdepth "$findMaxDepth" -type d -name ".git" 2>/dev/random | parallel readlink -f '{}' | sort -u | parallel dirname '{}' | sort -u)";
# Perform git verify operations on each directory
printf "%s" "$dir_list" | parallel git_verify_ops '{}';