Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commitf7aa06b

Browse files
committed
Add resource slug input support for txpull
1 parent835ae0d commitf7aa06b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎txpull

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
#!/bin/sh
22

3+
set -e
4+
35
if [-z"$1" ];then
46
echo"Usage: ./txpull <po file path> [<options or arguments for tx pull>]"
57
exit 1
68
fi
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
1117
fi
1218

13-
file="$1"
19+
resource_slug=$(cat .tx/config| grep -B 3$file| grep"python-36-tw"| head -n 1| sed's/\[\(.*\)\]/\1/')
1420
shift
1521

16-
resource_slug="$(cat .tx/config| grep -B 3$file| grep"python-36-tw"| head -n 1| sed's/\[\(.*\)\]/\1/')"
1722
if [-z"$resource_slug" ];then
18-
echo"Resource of file$file not found"
23+
echo"Cannot find resource slug of$file"
1924
exit 1
2025
fi
2126

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp