You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a global variable (MERGE_HAD_FALLBACK) instead of return codes
for merge_ftl, and use if/fi instead of [ ] && cmd in restore_en.
Both patterns caused silent script abortion under set -euo pipefail
when returning non-zero exit codes.
@@ -176,10 +181,11 @@ for lang in "${!LANG_MAP[@]}"; do
176
181
weblate_lang="${ftl_name//-/_}"
177
182
forutilin"${!fallback_utils[@]}";do
178
183
md_file="docs/src/utils/${util}.md"
179
-
[ -f"$md_file" ] ||continue
180
-
notice="<div class=\"warning\">Some strings on this page have not been translated yet. You can help by <a href=\"https://hosted.weblate.org/projects/rust-coreutils/${util}/${weblate_lang}/\">translating them on Weblate</a>.</div>"
181
-
# Insert notice after the first line (# utility-name)
182
-
sed -i "1a\\${notice}""$md_file"
184
+
if [ -f"$md_file" ];then
185
+
notice="<div class=\"warning\">Some strings on this page have not been translated yet. You can help by <a href=\"https://hosted.weblate.org/projects/rust-coreutils/${util}/${weblate_lang}/\">translating them on Weblate</a>.</div>"
186
+
# Insert notice after the first line (# utility-name)
187
+
sed -i "1a\\${notice}""$md_file"
188
+
fi
183
189
done
184
190
if [ ${#fallback_utils[@]}-gt 0 ];then
185
191
echo" Added translation notice to ${#fallback_utils[@]} utilities with untranslated strings"
0 commit comments