To having this work for you, replace PYTHON_APP (or entire script function) to your specific needs.
Have fun!
#!/bin/bash SLEEP_INTERVAL=2 # second PYTHON_APP="python3 -m tasty serve:web --port=9100" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" script () { cd $DIR PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 PYTHONDONTWRITEBYTECODE=1 PYTHONDEBUG=1 PYTHONIOENCODING=utf8 $PYTHON_APP } echo "Development mode." until script; do echo "Crashed with exit code $?. Respawning.." >&2 sleep $SLEEP_INTERVAL done
No comments:
Post a Comment
New comment