summaryrefslogtreecommitdiff
path: root/search_repo
diff options
context:
space:
mode:
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]+://"