From: Steven Baltakatei Sandoval Date: Sat, 8 Jul 2023 12:08:07 +0000 (+0000) Subject: feat(user/bk-find-git-verify):Follow symbolic links X-Git-Tag: 0.8.2^2 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/90eca88ef19874660e09705cbd479fd9c145fc01 feat(user/bk-find-git-verify):Follow symbolic links --- 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 '{}';