OSDN Git Service

Fix indent
[wesnoth-ja/ja-po.git] / update.sh
1 #!/bin/bash
2
3 set -eu
4
5 source ./api_token.sh
6
7 TXDIR=transifex
8 TXPROJECT=wesnoth-dev-japanese
9 RESOURCES="wesnoth \
10            wesnoth-ai \
11            wesnoth-anl \
12            wesnoth-aoi \
13            wesnoth-did \
14            wesnoth-dm \
15            wesnoth-dw \
16            wesnoth-editor \
17            wesnoth-ei \
18            wesnoth-help \
19            wesnoth-httt \
20            wesnoth-l \
21            wesnoth-lib \
22            wesnoth-low \
23            wesnoth-manpages \
24            wesnoth-manual \
25            wesnoth-multiplayer \
26            wesnoth-nr \
27            wesnoth-sof \
28            wesnoth-sota \
29            wesnoth-sotbe \
30            wesnoth-tb \
31            wesnoth-test \
32            wesnoth-thot \
33            wesnoth-trow \
34            wesnoth-tsg \
35            wesnoth-tutorial \
36            wesnoth-units \
37            wesnoth-utbs"
38
39 # set transifex project
40 if [ ! -e ${TXDIR} ]; then
41   mkdir ${TXDIR}
42   tx init ${TX_DIR} --token=${TX_TOKEN} --force --no-interactive
43   cd ${TXDIR}
44     tx config mapping-remote https://www.transifex.com/projects/p/${TXPROJECT}/
45     cd ../
46 fi
47
48 cd ${TXDIR}
49 tx pull -a
50 cd ../
51
52 for RESOURCE in ${RESOURCES}
53 do
54   if [ ! -e ${RESOURCE} ]; then
55     mkdir -p ${RESOURCE}
56   fi
57   cp ${TXDIR}/translations/${TXPROJECT}.${RESOURCE}/ja.po ${RESOURCE}/ja.po
58 done
59
60 git add .
61 git commit -m "Transifexと同期"
62 git push origin master