File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/sh
22
3+ set -e
4+
35if [ -z " $1 " ]; then
46 echo " Usage: ./txpull <po file path> [<options or arguments for tx pull>]"
57 exit 1
68fi
79
8- if [ ! -f " $1 " ]; then
9- echo " File $1 does not exist"
10- exit 1
10+ if [ -f " $1 " ]; then
11+ file=$1
12+ elif [ -n " $( cat .tx/config | grep " \[python-36-tw\.$1 \]" ) " ]; then
13+ file=$( cat .tx/config | grep -A 3 " \[python-36-tw\.$1 ]" | grep " trans.zh_TW = " | sed ' s/trans\.zh_TW = //' )
14+ else
15+ echo " Cannot find file or resource $1 "
16+ exit 1
1117fi
1218
13- file= " $1 "
19+ resource_slug= $( cat .tx/config | grep -B 3 $file | grep " python-36-tw " | head -n 1 | sed ' s/\[\(.*\)\]/\1/ ' )
1420shift
1521
16- resource_slug=" $( cat .tx/config | grep -B 3 $file | grep " python-36-tw" | head -n 1 | sed ' s/\[\(.*\)\]/\1/' ) "
1722if [ -z " $resource_slug " ]; then
18- echo " Resource of file $file not found "
23+ echo " Cannot find resource slug of $file "
1924 exit 1
2025fi
2126
You can’t perform that action at this time.
0 commit comments