1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-08 05:32:39 +00:00
trezor-firmware/core/tools/build_templates
obrusvit 8c52f0d5e8 feat(core): add arg to gen_font.py to gen C data
- usage with `--gen-c`
- default is now Rust

[no changelog]
2025-02-06 13:32:29 +01:00

30 lines
771 B
Bash
Executable File

#!/bin/sh
set -e
CWD=`dirname "$0"`
RENDER="$CWD/../vendor/trezor-common/tools/cointool.py render -M T1B1"
# Search both in `core/src` and `core/embed`
# - Solana templates are excluded since those are handled separately
# - `gen_font.mako` is excluded as it's used from `gen_font.py`
FIND_TEMPLATES="find $CWD/.. -name *.mako -not -name _proto* -not -path *solana* -not -name gen_font.mako"
check_results() {
CHECK_FAIL=0
for filename in $($FIND_TEMPLATES); do
TMP=`mktemp`
TARGET="${filename%%.mako}"
$RENDER "$filename" -o $TMP
if ! diff -u "$TARGET" "$TMP"; then
CHECK_FAIL=1
fi
done
exit $CHECK_FAIL
}
if [ "$1" = "--check" ]; then
check_results
else
$FIND_TEMPLATES | xargs $RENDER
fi