1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 08:38:07 +00:00
trezor-firmware/core/tools/build_templates

29 lines
631 B
Plaintext
Raw Normal View History

#!/bin/sh
set -e
CWD=`dirname "$0"`
RENDER="$CWD/../vendor/trezor-common/tools/cointool.py render"
FIND_TEMPLATES="find $CWD/../src -name *.mako"
check_results() {
CHECK_FAIL=0
for filename in $($FIND_TEMPLATES); do
# ignore resources.py
if echo $filename | grep -q "resources.py.mako$"; then continue; fi
TMP=`mktemp`
TARGET="${filename%%.mako}"
$RENDER "$filename" -o $TMP
2018-08-27 17:56:38 +00:00
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