From c1c38dd760dcbd8649e6af08ae76d448551b81b5 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Wed, 15 Mar 2023 14:20:29 +0100 Subject: [PATCH] chore: cut.sh now exits with error if there are missing translations --- scripts/rel/cut.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/rel/cut.sh b/scripts/rel/cut.sh index 19a03a98d..08fa37192 100755 --- a/scripts/rel/cut.sh +++ b/scripts/rel/cut.sh @@ -233,10 +233,17 @@ if [ -d "${CHECKS_DIR}" ]; then fi generate_changelog () { - local from_tag="${PREV_TAG:-}" + local from_tag num_en num_zh + from_tag="${PREV_TAG:-}" if [[ -z $from_tag ]]; then from_tag="$(./scripts/find-prev-rel-tag.sh "$PROFILE")" fi + num_en=$(git diff --name-only -a "${from_tag}...HEAD" "changes" | grep -c '.en.md') + num_zh=$(git diff --name-only -a "${from_tag}...HEAD" "changes" | grep -c '.zh.md') + if [ "$num_en" -ne "$num_zh" ]; then + echo "Number of English and Chinese changelog files added since ${from_tag} do not match." + exit 1 + fi ./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'en' -v "$TAG" > "changes/${TAG}.en.md" ./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'zh' -v "$TAG" > "changes/${TAG}.zh.md" if [ -n "$(git diff --stat)" ]; then