Make sure watching doesn't stop if build fails

This commit is contained in:
Charlotte Van Petegem 2024-01-16 12:56:33 +01:00
parent 1f2ecfc8c1
commit e030a43db4
No known key found for this signature in database
GPG key ID: 019E764B7184435A

View file

@ -157,17 +157,17 @@
trap "rm \"''${builddir}\" -rf; exit 0" SIGINT SIGTERM
if [ -e book.pdf ]
then
time=$(stat -c %Y book.pdf)
time=$(stat -c %Y book.pdf)
else
time=$(date "+%s")
build "''${builddir}"
time=$(date "+%s")
build "''${builddir}" || ${pkgs.libnotify}/bin/notify-send "Build failed"
fi
while true
do
while [ "$time" -lt "$(stat -c %Y book.org)" ]
do
time=$(date "+%s")
build "''${builddir}"
build "''${builddir}" || ${pkgs.libnotify}/bin/notify-send "Build failed"
done
time=$(date "+%s")
echo "Waiting for change..."