绕过检查:一次只允许发布一篇译文,修复相关逻辑错误

This commit is contained in:
Wenxuan Zhao 2018-12-06 04:57:15 +08:00
parent 7a3ec58401
commit 4469e17282
No known key found for this signature in database
GPG Key ID: 0B45B13F10587A57

View File

@ -47,20 +47,20 @@ rule_translation_completed() {
&& [ "$TOTAL" -eq 2 ] && echo "匹配规则:提交译文"
}
# 校对译文:只能校对一篇
# 校对译文:只能校对一篇译文
rule_translation_revised() {
[ "$TSL_M" -eq 1 ] \
&& check_category TSL M \
&& [ "$TOTAL" -eq 1 ] && echo "匹配规则:校对译文"
}
# 发布译文:发布多篇译文
# 发布译文:只能发布一篇译文
rule_translation_published() {
[ "$TSL_D" -ge 1 ] && [ "$PUB_A" -ge 1 ] && [ "$TSL_D" -eq "$PUB_A" ] \
&& ensure_identical SRC D TSL A 1 \
[ "$TSL_D" -eq 1 ] && [ "$PUB_A" -eq 1 ] \
&& ensure_identical TSL D PUB A 1 \
&& check_category TSL D \
&& [ "$TOTAL" -eq $((TSL_D + PUB_A)) ] \
&& echo "匹配规则:发布译文 ${PUB_A}"
&& echo "匹配规则:发布译文"
}
# 定义常见错误