emu: add -r option to restart (and reload sources) when sources are changed

This commit is contained in:
Pavol Rusnak 2016-11-17 13:08:49 +01:00
parent 93ad93ff94
commit 5be6a82682
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
1 changed files with 10 additions and 0 deletions

10
emu.sh
View File

@ -16,6 +16,16 @@ case "$1" in
shift
gdb --args ../vendor/micropython/unix/micropython $ARGS $* $MAIN
;;
"-r")
shift
while true; do
../vendor/micropython/unix/micropython $ARGS $* $MAIN &
UPY_PID=$!
find -name '*.py' | inotifywait -q -e close_write --fromfile -
echo Restarting ...
kill $UPY_PID
done
;;
"-p")
shift
../vendor/micropython/unix/micropython $ARGS $* $MAIN &