aboutsummaryrefslogtreecommitdiff
path: root/number-of-pr-in
diff options
context:
space:
mode:
authorclyhtsuriva <aimeric@adjutor.xyz>2022-11-02 22:21:53 +0100
committerclyhtsuriva <aimeric@adjutor.xyz>2022-11-02 22:21:53 +0100
commit98da0fa1869757734610ec34fbeb0396f26c0026 (patch)
treeb0aeaa30a96f27bccfc4b463861b1fd476155d43 /number-of-pr-in
parent852a96b3cf69bb80773f926921c9d3f6b0101faf (diff)
Putting the first scripts in a bin/ folder
Diffstat (limited to 'number-of-pr-in')
-rwxr-xr-xnumber-of-pr-in42
1 files changed, 0 insertions, 42 deletions
diff --git a/number-of-pr-in b/number-of-pr-in
deleted file mode 100755
index a32e4b5..0000000
--- a/number-of-pr-in
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env bash
-#
-# number-of-pr-in
-# Author : Clyhtsuriva
-
-usage () {
- echo "Usage: number-of-pr-in <repository>"
- exit 1
-}
-
-number-of-pr-in () {
-
- [ $# -eq 1 ] || usage
-
- GH_REPO=void-linux/$1
- LIMIT=1000 # Search API => 1000 results max
-
- gh repo view "$GH_REPO" 1> /dev/null || exit 1
-
- GH_PR_LIST=$(gh pr list \
- --repo "$GH_REPO" \
- --author "@me" \
- --state merged \
- --limit $LIMIT)
-
- PARSED=$(echo "$GH_PR_LIST" | \
- awk '{ print $2 }' | \
- sed 's/://g' | \
- sort | \
- uniq -c | \
- sort -nr | \
- sed 's/ //g')
-
-
- COLOR_ON=$(tput setaf 3; tput bold)
- COLOR_OFF=$(tput sgr0)
-
- # shellcheck disable=SC2001
- echo "$PARSED" | sed "s/[^[:blank:]]\{1,\}/$COLOR_ON&$COLOR_OFF/1"
-}
-
-number-of-pr-in "$@"