feat(LICENSE, AUTHORS): MIT -> GPL-3.0, authors.sh

This commit is contained in:
2024-09-21 15:34:12 +03:00
parent f8417be18c
commit 7b0b06a1fe
3 changed files with 695 additions and 5 deletions

20
authors.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
RESPONSE=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/vSEK1RO/libbasen/contributors)
LOGIN=$(echo "$RESPONSE" | sed -n /login/p | sed 's/ \"login\": \"//' | sed 's/\",//')
CONTRIBUTIONS=$(echo "$RESPONSE" | sed -n /contributions/p | sed 's/ \"contributions\": //' | sed 's/,//')
IFS=$'\n' read -r -d '' -a arr1 <<< "$CONTRIBUTIONS"
IFS=$'\n' read -r -d '' -a arr2 <<< "$LOGIN"
AUTHORS=$'libbasen project authors:\n\n'
AUTHORS+=$(printf "%7s | %s" "commits" "username")$'\n'
for ((i = 0; i < ${#arr1[@]}; i++)); do
AUTHORS+=$(printf "%7s | %s" "${arr1[$i]}" "${arr2[$i]}")$'\n'
done
echo "$AUTHORS" > AUTHORS