-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathupload-catalog
30 lines (27 loc) · 995 Bytes
/
upload-catalog
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
#!/bin/bash
set -eux
# clone an additional repository
cd "${BASEDIR}"
git clone --branch ${CATALOG_BRANCH} https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog
mkdir -p "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
ln -s "${BASEDIR}"/python-docs-ja LC_MESSAGES
ls -lF LC_MESSAGES
# upload catalogs to python-docs-ja
cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales
if [ ! -e .tx/config ]; then
echo ".tx/config does not exist. Skip uploading catalogs to python-docs-ja"
exit 0
fi
tx pull --force --language ja --parallel
cd ja/LC_MESSAGES
git add *.po **/*.po
git status
if [[ $(git status --short | wc -l) == 0 ]]; then
echo "no .po file to upload"
else
echo "I have .po file(s) to upload"
git commit --message="[skip ci] Update .po files"
git push --quiet "[email protected]:python/python-docs-ja.git" ${DOCS_BRANCH}:${DOCS_BRANCH}
fi
rm -rf "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja