2018-08-22 11:48:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
CWD=`dirname "$0"`
|
|
|
|
RENDER="$CWD/../vendor/trezor-common/tools/cointool.py render"
|
|
|
|
|
2023-10-18 10:02:09 +00:00
|
|
|
# Search both in `core/src` and `core/embed` - Solana templates are excluded since those are handled separately
|
|
|
|
FIND_TEMPLATES="find $CWD/.. -name *.mako -not -name _proto* -not -path *solana*"
|
2018-08-22 11:48:32 +00:00
|
|
|
|
|
|
|
check_results() {
|
|
|
|
CHECK_FAIL=0
|
|
|
|
for filename in $($FIND_TEMPLATES); do
|
|
|
|
TMP=`mktemp`
|
|
|
|
TARGET="${filename%%.mako}"
|
|
|
|
$RENDER "$filename" -o $TMP
|
2018-08-27 17:56:38 +00:00
|
|
|
if ! diff -u "$TARGET" "$TMP"; then
|
2018-08-22 11:48:32 +00:00
|
|
|
CHECK_FAIL=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
exit $CHECK_FAIL
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" = "--check" ]; then
|
|
|
|
check_results
|
|
|
|
else
|
|
|
|
$FIND_TEMPLATES | xargs $RENDER
|
|
|
|
fi
|