summaryrefslogtreecommitdiff
path: root/search_repo
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2020-01-08 19:56:11 +0000
committerKatolaZ <katolaz@freaknet.org>2020-01-08 19:56:11 +0000
commit3e559a8ecad2c03880c1105a729b69faaa2eb362 (patch)
treee480f9660f41fc80536f66839e7443af8ccf1231 /search_repo
parent8545883d676207a4f0ed01079aa8fccfa1e31c7a (diff)
improve presentation in searcg_cgi
Diffstat (limited to 'search_repo')
-rwxr-xr-xsearch_repo6
1 files changed, 6 insertions, 0 deletions
diff --git a/search_repo b/search_repo
index 65dd9c5..0f4f42c 100755
--- a/search_repo
+++ b/search_repo
@@ -15,10 +15,16 @@ shift
WORDS="$@"
query=$(echo "$WORDS" | sed -E 's/\ /\|/g')
+echo "$query"
cd "$FOLDER"
+repos=$(find ./ -type d | grep -E "\/.*\/" | grep -Ei "$query" | \
+ sed -E 's/.\/([a-z]+)\//\1:\/\//1')
+
res=$(grep -Eric "$query" | grep -v ":0$" | sort -t ':' -rnk2 | \
sed -E 's/([a-z]+)\//\1:\/\//1;s/\/[^\/]*$//' )
+echo "$repos" | grep -Ei "^[a-z]+://"
+echo "--" >&2
echo "$res" | grep -Ei "^[a-z]+://"