Skip to content

Commit 9982340

Browse files
committed
write log files for checks
1 parent 019f549 commit 9982340

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

sources/scripts/check_fonts.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ source sources/scripts/setup_shell.sh
1313
# Set default font directory if not provided
1414
readonly FONT_DIR=${1:-"sources/output"}
1515
readonly REPORT_PATH="$FONT_DIR/report.md"
16+
readonly LOG_TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
17+
readonly LOG_PATH="$FONT_DIR/fontbakery-$LOG_TIMESTAMP.log"
1618

1719
# Ensure font directory exists and contains TTF files
1820
if [ ! -d "$FONT_DIR" ]; then
@@ -29,15 +31,26 @@ fi
2931

3032
# Run Fontbakery checks on fonts
3133
echo "Running Fontbakery checks on fonts in $FONT_DIR..."
34+
{
35+
echo "Fontbakery log - $(date -Iseconds)"
36+
echo "Font directory: $FONT_DIR"
37+
echo
38+
} > "$LOG_PATH"
3239

3340
# Note: We disable opentype/monospace because it incorrectly flags our
3441
# quasi-proportional font as monospaced. This is due to a majority of glyphs
3542
# sharing a common width, even though the font is not intended to be monospaced.
3643
# See: https://github.com/fonttools/fontbakery/blob/ffe83a2824631ddbabdbf69c47b8128647de30d1/Lib/fontbakery/checks/conditions.py#L50
44+
set +e
3745
fontbakery check-googlefonts \
3846
-C --succinct --loglevel FAIL \
3947
--exclude-checkid opentype/monospace \
4048
--ghmarkdown "$REPORT_PATH" \
41-
$TTF_FILES || true
49+
$TTF_FILES 2>&1 | tee -a "$LOG_PATH"
50+
FONTBAKERY_EXIT=${PIPESTATUS[0]}
51+
set -e
52+
53+
echo >> "$LOG_PATH"
54+
echo "Fontbakery exit code: $FONTBAKERY_EXIT" >> "$LOG_PATH"
4255

4356
echo "Font validation complete. Report saved to $REPORT_PATH"

0 commit comments

Comments
 (0)