Auto-update: Tue Jul 30 21:21:00 PDT 2024
This commit is contained in:
parent
9155daf978
commit
bfd5206a9c
1 changed files with 19 additions and 0 deletions
19
gitscan
Executable file
19
gitscan
Executable file
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue