2019-06-26 10:16:41 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-06-12 23:24:47 +00:00
|
|
|
|
2019-05-20 13:10:47 +00:00
|
|
|
MICROPYTHON="${MICROPYTHON:-${PWD}/build/unix/micropython}"
|
|
|
|
TREZOR_SRC=$(cd "${PWD}/src/"; pwd)
|
|
|
|
BROWSER="${BROWSER:-chromium}"
|
2016-11-16 22:45:56 +00:00
|
|
|
|
2019-05-20 13:10:47 +00:00
|
|
|
source ./trezor_cmd.sh
|
2016-06-12 23:24:47 +00:00
|
|
|
|
2019-05-20 13:10:47 +00:00
|
|
|
cd "${TREZOR_SRC}"
|
2016-06-12 23:24:47 +00:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
"-d")
|
|
|
|
shift
|
2018-10-09 12:35:52 +00:00
|
|
|
OPERATING_SYSTEM=$(uname)
|
2019-05-28 08:19:18 +00:00
|
|
|
if [ "$OPERATING_SYSTEM" = "Darwin" ]; then
|
2019-05-20 13:10:47 +00:00
|
|
|
PATH=/usr/bin /usr/bin/lldb -f $MICROPYTHON -- $ARGS $* $MAIN
|
2018-10-09 12:35:52 +00:00
|
|
|
else
|
2019-05-20 13:10:47 +00:00
|
|
|
gdb --args $MICROPYTHON $ARGS $* $MAIN
|
2018-10-09 12:35:52 +00:00
|
|
|
fi
|
2016-06-12 23:24:47 +00:00
|
|
|
;;
|
2016-11-17 12:08:49 +00:00
|
|
|
"-r")
|
|
|
|
shift
|
|
|
|
while true; do
|
2019-05-20 13:10:47 +00:00
|
|
|
$MICROPYTHON $ARGS $* $MAIN &
|
2016-11-17 12:08:49 +00:00
|
|
|
UPY_PID=$!
|
|
|
|
find -name '*.py' | inotifywait -q -e close_write --fromfile -
|
|
|
|
echo Restarting ...
|
|
|
|
kill $UPY_PID
|
|
|
|
done
|
|
|
|
;;
|
2016-06-12 23:24:47 +00:00
|
|
|
*)
|
2019-05-20 13:10:47 +00:00
|
|
|
echo "Starting emulator: $MICROPYTHON $ARGS $* $MAIN"
|
|
|
|
$MICROPYTHON $ARGS $* $MAIN 2>&1 | tee "${TREZOR_LOGFILE}"
|
|
|
|
exit ${PIPESTATUS[0]}
|
2016-06-12 23:24:47 +00:00
|
|
|
esac
|