-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenerate_commit_notes.sh
executable file
·56 lines (47 loc) · 1.19 KB
/
generate_commit_notes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Header
echo "Automated server sync"
echo
strip_key() {
name="$1"
name="${name%\"}"
name="${name#$2}"
name="${name#=}"
name="${name#_}"
name="${name#\"}"
echo "$name"
}
# New and updated add-ons
for file in $(git --no-pager diff --name-status --no-color --cached addons/*/addon | awk '$1 != "D" { print $NF}')
do
name="${file%/addon}"
name="${name#addons/}"
versionold="$(git diff --cached "$file" | grep -P -- '^-version=')"
versionold="$(strip_key "$versionold" "-version")"
if [ -n "$versionold" ]
then
versionnew="$(grep -P -- '^version=' "$file")"
versionnew="$(strip_key "$versionnew" "version")"
echo "- Updated $name from $versionold to $versionnew"
else
echo "- New add-on $name"
fi
done
# Updated translations
find_updated_translations() {
for file in $(git --no-pager diff --name-status --no-color --cached i18n/*.wad | awk '$1 != "D" { print $NF}')
do
file="${file#i18n/}"
file="${file%/*.mo}"
echo "$file"
done
}
for addon in $(find_updated_translations | sort --unique)
do
echo "- Updated translations for $addon"
done
# Website map versions
if [ -n "$(git diff --cached website_maps_i18n_version)" ]
then
echo "- Updated website map translations"
fi