You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/emu.sh

36 lines
916 B

#!/usr/bin/env bash
MICROPYTHON="${MICROPYTHON:-${PWD}/build/unix/micropython}"
TREZOR_SRC=$(cd "${PWD}/src/"; pwd)
BROWSER="${BROWSER:-chromium}"
source ./trezor_cmd.sh
cd "${TREZOR_SRC}"
case "$1" in
"-d")
shift
OPERATING_SYSTEM=$(uname)
if [ "$OPERATING_SYSTEM" = "Darwin" ]; then
PATH=/usr/bin /usr/bin/lldb -f $MICROPYTHON -- $ARGS $* $MAIN
else
gdb --args $MICROPYTHON $ARGS $* $MAIN
fi
;;
"-r")
shift
while true; do
$MICROPYTHON $ARGS $* $MAIN &
UPY_PID=$!
find -name '*.py' | inotifywait -q -e close_write --fromfile -
echo Restarting ...
kill $UPY_PID
done
;;
*)
echo "Starting emulator: $MICROPYTHON $ARGS $* $MAIN"
$MICROPYTHON $ARGS $* $MAIN 2>&1 | tee "${TREZOR_LOGFILE}"
exit ${PIPESTATUS[0]}
esac