mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
Update author listing script with support for several years
Did this months ago but never got to actually committing it...
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
|||||||
.doctrees
|
.doctrees
|
||||||
*.mo
|
*.mo
|
||||||
|
authors.txt
|
||||||
|
langs.txt
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -euo pipefail
|
if [ -z $1 ]; then
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "Pass a commit hash as argument to list authors between that commit and HEAD."
|
echo "Pass a commit hash as argument to list authors between that commit and HEAD."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -13,16 +10,22 @@ commit=$1
|
|||||||
rm -f authors.txt langs.txt
|
rm -f authors.txt langs.txt
|
||||||
|
|
||||||
for file in weblate/*.po; do
|
for file in weblate/*.po; do
|
||||||
authors=$(git log "$commit"..HEAD --date=format:"%Y" --format="%aN <%aE>, %ad." "$file" | grep -v 'anonymous' | sort -u)
|
authors=$(git log $commit..HEAD --date=format:"%Y" --format="%aN <%aE>, %ad." $file | grep -v 'anonymous' | sort -u)
|
||||||
if [ -n "$authors" ]; then
|
if [ ! -z "$authors" ]; then
|
||||||
new_authors=""
|
new_authors=""
|
||||||
while read -r author; do
|
while read -r author; do
|
||||||
found=$(grep "$author" "$file")
|
author_name=$(echo "$author" | sed 's/20[0-9][0-9].//')
|
||||||
if [ -z "$found" ]; then
|
author_year=$(echo "$author" | sed 's/.*\(20[0-9][0-9]\).*/\1/')
|
||||||
new_authors+=$author$'\n'
|
found_name=$(grep "$author_name" $file)
|
||||||
|
found_year=
|
||||||
|
if [ ! -z "$found_name" ]; then
|
||||||
|
found_year=$(grep "$author_year" <<< "$found_name")
|
||||||
|
fi
|
||||||
|
if [ -z "$found_name" -o -z "$found_year" ]; then
|
||||||
|
new_authors+=$author$'\n'
|
||||||
fi
|
fi
|
||||||
done <<< "$authors"
|
done <<< "$authors"
|
||||||
if [ -z "$new_authors" ]; then
|
if [ ! -z "$new_authors" ]; then
|
||||||
echo "$file" >> langs.txt
|
echo "$file" >> langs.txt
|
||||||
echo -e "\n* $file:\n" >> authors.txt
|
echo -e "\n* $file:\n" >> authors.txt
|
||||||
echo "$new_authors" >> authors.txt
|
echo "$new_authors" >> authors.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user