Skip to content

Commit

Permalink
feat: add download all repos and search
Browse files Browse the repository at this point in the history
  • Loading branch information
n-ae committed Nov 5, 2024
1 parent d43822c commit 76690f7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions useful-scripts/sh/download-search-repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

owner="freight-hub"
gh repo list ${owner} --no-archived --limit 4000 | while read -r repo _; do
gh repo clone "$repo" "$repo"
done

string1="transport-network.api"
string2="depots"

# list the files involving the strings
rg -l ${string1} > results1.txt
rg -l ${string2} > results2.txt

# extract prefix (i.e repo name) and write it to different file
awk -F'/' '{print $1}' results1.txt | sort | uniq > repos1.txt
awk -F'/' '{print $1}' results2.txt | sort | uniq > repos2.txt

# list common ones
comm -12 repos1.txt repos2.txt

0 comments on commit 76690f7

Please sign in to comment.