-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathhhdrel.sh
More file actions
executable file
·44 lines (39 loc) · 1.36 KB
/
hhdrel.sh
File metadata and controls
executable file
·44 lines (39 loc) · 1.36 KB
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
hhdrel ()
{
# Check we have at least two parameters
if [ $# -lt 1 ]
then
echo "Usage: hhdrel <version>"
return
fi
relver=$1
tag=v$1
if [ ! -f './hhd.spec' ]; then
echo "No hhd.spec found. Wrong dir"
return
fi
(
set -e
# Update translations
pybabel extract --no-location -F i18n/babel.cfg -o i18n/hhd.tmp.pot src/hhd
pybabel extract --no-location -F i18n/babel.cfg -o i18n/adjustor.tmp.pot src/adjustor
msgmerge --update --backup=none i18n/hhd.pot i18n/hhd.tmp.pot
msgmerge --update --backup=none i18n/adjustor.pot i18n/adjustor.tmp.pot
rm i18n/*.tmp.pot
# for lang in $(ls i18n | grep -Eo '^.+_.+$'); do
# pybabel update -D hhd -i i18n/hhd.pot -d i18n -l $lang
# pybabel update -D adjustor -i i18n/adjustor.pot -d i18n -l $lang
# done
sed -i "s/version = \".*\"/version = \"$relver\"/" pyproject.toml
sed -i "s/^Version: *.*/Version: $relver/" hhd.spec
sed -i "s/^pkgver=.*/pkgver=$relver/" PKGBUILD
pybabel compile -D hhd -d ./i18n
pybabel compile -D adjustor -d ./i18n
# find i18n -type f -name "*.po*" -exec sed -i 's/^"POT-Creation-Date: .*"/"POT-Creation-Date: 2020-01-01 00:00+0000\\n"/' {} +
git add pyproject.toml PKGBUILD hhd.spec i18n/*
git commit -m "bump to $relver"
git tag -f $tag && git push origin $tag -f
) &&
xdg-open "https://github.com/hhd-dev/hhd/releases/new?tag=$tag"
}
hhdrel $1