Skip to content

Commit

Permalink
ci: allow debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
ksqsf committed Nov 30, 2023
1 parent 09c7421 commit eed21ed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions make_simp_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 12 additions & 4 deletions tools/update_compact_dicts.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

STRICT=x"$1"
STRICT="$1"

echo Strict about errors? $STRICT

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eed21ed

Please sign in to comment.