-
Notifications
You must be signed in to change notification settings - Fork 10
/
sync_opencc.sh
executable file
·56 lines (45 loc) · 1.17 KB
/
sync_opencc.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
56
#!/bin/bash
#uname -a
#pwd
#ls -la
#git branch -a
#git config --list
#git fetch origin main
git checkout main
git checkout .
git branch -a
#ls -la
#git log
opencc_file_list=(
HKVariants.txt
JPVariants.txt
STCharacters.txt
TSCharacters.txt
TWVariants.txt
)
for ((i=0; i<${#opencc_file_list[@]}; i++ ))
do
sha1sum data/opencc-data/${opencc_file_list[i]}
wget https://raw.githubusercontent.com/BYVoid/OpenCC/master/data/dictionary/${opencc_file_list[i]} -O data/opencc-data/${opencc_file_list[i]} || exit 1
#curl https://raw.githubusercontent.com/BYVoid/OpenCC/master/data/dictionary/${opencc_file_list[i]} > data/opencc-data/${opencc_file_list[i]}
git config user.name bot
git config user.email [email protected]
sha1sum data/opencc-data/${opencc_file_list[i]}
git add data/opencc-data/${opencc_file_list[i]}
git diff
git commit -m "sync opencc ${opencc_file_list[i]}"
#git log
done
pushd .
cd data/opencc-data
node pre.js || exit 1
git add -u data/opencc-data-*.json
git commit -m "run opencc pre.js"
popd
pushd .
cd data/summary-data
node pre.js || exit 1
git add -u data/summary-data-*.json
git commit -m "run summary pre.js"
popd
git push