From 6051934337b38564cfcd531e84c1df11b2a3380c Mon Sep 17 00:00:00 2001 From: sanj <67624670+iodrift@users.noreply.github.com> Date: Tue, 30 Jul 2024 21:24:47 -0700 Subject: [PATCH] Auto-update: Tue Jul 30 21:24:47 PDT 2024 --- gitscan | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gitscan b/gitscan index 46403d3..d54e922 100755 --- a/gitscan +++ b/gitscan @@ -8,8 +8,8 @@ mkdir -p "$(dirname "$output_file")" # Clear the existing file > "$output_file" -# Find all .git directories, excluding hidden directories -find ~/ -type d -name ".git" -not -path "*/.*/*" | while read -r gitdir; do +# Find all .git directories, excluding hidden directories and suppressing permission denied errors +find ~/ -type d -name ".git" -not -path "*/.*/*" 2>/dev/null | while read -r gitdir; do # Get the parent directory of the .git folder repo_path=$(dirname "$gitdir") echo "$repo_path" >> "$output_file" @@ -17,3 +17,9 @@ done echo "Git repositories have been written to $output_file" +# Remove duplicate entries +sort -u "$output_file" -o "$output_file" + +echo "Duplicate entries removed. Final list:" +cat "$output_file" +