X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/24eabaf97cd8d1074f6ed96e09d706ae1b0e7a1a..942ea2dfc5aaa1cc100e8327776ee9a3b90953ec:/user/bk-find-git-verify?ds=sidebyside diff --git a/user/bk-find-git-verify b/user/bk-find-git-verify index a94dc06..333880f 100755 --- a/user/bk-find-git-verify +++ b/user/bk-find-git-verify @@ -2,7 +2,10 @@ # 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 @@ -52,7 +55,7 @@ main() { 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 '{}';