From bfd5206a9c943f532301dacdc5de4cf19b559b72 Mon Sep 17 00:00:00 2001 From: sanj <67624670+iodrift@users.noreply.github.com> Date: Tue, 30 Jul 2024 21:21:00 -0700 Subject: [PATCH] Auto-update: Tue Jul 30 21:21:00 PDT 2024 --- gitscan | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 gitscan diff --git a/gitscan b/gitscan new file mode 100755 index 0000000..46403d3 --- /dev/null +++ b/gitscan @@ -0,0 +1,19 @@ +#!/bin/bash + +output_file=~/workshop/repos.txt + +# Ensure the output directory exists +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 + # Get the parent directory of the .git folder + repo_path=$(dirname "$gitdir") + echo "$repo_path" >> "$output_file" +done + +echo "Git repositories have been written to $output_file" +