diff --git a/make_simp_dist.sh b/make_simp_dist.sh index e3c8df1..4bf9bd0 100755 --- a/make_simp_dist.sh +++ b/make_simp_dist.sh @@ -75,6 +75,9 @@ cd .. echo 打包... if [ x$BUILD_TYPE = x"github" ]; then + # GitHub Actions will take over the tarball creation. + rm -rf dist/tools + rm -rf dist/.git exit 0 fi diff --git a/tools/update_compact_dicts.sh b/tools/update_compact_dicts.sh index 05cad45..b58e148 100755 --- a/tools/update_compact_dicts.sh +++ b/tools/update_compact_dicts.sh @@ -1,6 +1,6 @@ #!/bin/bash -STRICT=x"$1" +STRICT="$1" echo Strict about errors? $STRICT @@ -34,11 +34,19 @@ update_compact_dict() { extract_dict "$DICT_FILE" "$HEADER_FILE" "$INPUT_FILE" python3 schemagen.py update-compact-dict --rime-dict="$INPUT_FILE" > "$OUTPUT_FILE" - if [ $STRICT = x"yes" ] && grep '^# BAD' "$OUTPUT_FILE" + if grep '^# BAD' "$OUTPUT_FILE" then echo '!!! BAD DICT !!!' - rm -f $INPUT_FILE $HEADER_FILE - return 1 + + # Still allow grep to show bad entries. + if [ x$STRICT = x"yes" ]; then + rm -f $INPUT_FILE $HEADER_FILE + return 1 + else + cat "$HEADER_FILE" "$OUTPUT_FILE" > "$DICT_FILE" + rm -f $INPUT_FILE $HEADER_FILE $OUTPUT_FILE + return 0 + fi else cat "$HEADER_FILE" "$OUTPUT_FILE" > "$DICT_FILE" rm -f $INPUT_FILE $HEADER_FILE $OUTPUT_FILE