Skip to content

Commit

Permalink
Add a script to add new contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
azat committed Nov 20, 2022
1 parent d130d9f commit 7c8b3e9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions extra/release/update-contributors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

function path_in_repo()
{
echo "$(git rev-parse --show-toplevel)/$*"
}
function main()
{
local new_contributors
new_contributors="$(mktemp libevent.XXXXXX)"
trap "rm $new_contributors $new_contributors.filtered" EXIT

git log "$(git describe --abbrev=0)..HEAD" --pretty='format:%cN%n%aN' > "$new_contributors"
awk '/^ \* / { split($0, cols, " \\* "); print(cols[2]); }' "$(path_in_repo CONTRIBUTORS.md)" | {
grep -F -x -v -f "$new_contributors"
} | {
local grep_patterns=(
GitHub
)
grep -F -x -v "${grep_patterns[@]}"
} > "$new_contributors.filtered"
awk '{printf(" * %s\n", $0)}' "$new_contributors.filtered" >> "$(path_in_repo CONTRIBUTORS.md)"
}
main "$@"

0 comments on commit 7c8b3e9

Please sign in to comment.