mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 14:58:09 +00:00
36 lines
916 B
Bash
Executable File
36 lines
916 B
Bash
Executable File
#!/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
|