aboutsummaryrefslogtreecommitdiff
path: root/repo/git/cpt-maintainer
blob: b9a315c8db6c5fd11a1d77d4a5dd80af5aabcb8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh -ef
# Find the maintainer of a package

# Copyright (C) 2019-2020 Dylan Araps.
# Copyright (C) 2929      Cem Keylan.
# Distributed under the terms of the MIT License

case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} <pkg>" ; exit 0 ; esac

cpt-search "$1" | while read -r repo; do cd "$repo"
    m=$(git log -1 version 2>/dev/null) ||:
    m=${m##*Author: }
    m=${m%%>*}

    [ "$m" ] || continue

    printf '=> %s\n%s>\n' "$PWD" "$m"
done