From 4a1f97a0966b71cd23b41b42bc9af9937fc8d15b Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 20 Jan 2019 20:56:46 +0100 Subject: [PATCH] add a script to help with testing the application --- README.org | 8 ++++++++ scripts/debugging.sh | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 scripts/debugging.sh diff --git a/README.org b/README.org index e10d354..b4968c0 100644 --- a/README.org +++ b/README.org @@ -94,6 +94,14 @@ repository. #+begin_src sh make test #+end_src + +To make testing the application while programming a bit easier there's a script +which reloads the application everytime a file changes in the ~borg_qt~ +directory. You to use it run the following command from the root of the +repository. + +#+begin_src sh +./scripts/debugging.sh #+end_src ** Used packages diff --git a/scripts/debugging.sh b/scripts/debugging.sh new file mode 100755 index 0000000..3ed39f9 --- /dev/null +++ b/scripts/debugging.sh @@ -0,0 +1,20 @@ +#!/bin/bash +source venv/bin/activate + +sigint_handler() +{ + kill $PID + exit +} + +trap sigint_handler SIGINT + +cd borg_qt +while true; do + ./borg_qt.py & + PID=$! + echo "---- Press Crtl+C to stop debugging. ----" + inotifywait -e modify -e move -e create -e delete -e attrib --exclude '.*(/\.|_flymake\.py)' -r `pwd` + sleep 0.5 + kill $PID +done