aboutsummaryrefslogtreecommitdiff
path: root/update-pdf.sh
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2022-03-19 21:02:59 +0100
committerFranciszek Malinka <franciszek.malinka@gmail.com>2022-03-19 21:02:59 +0100
commite79d66fdd62e06bff773562daa7c29c1cba91bcc (patch)
treeba3be9c9eebc26b38e9b155efd17fe9359720e8b /update-pdf.sh
parente48745a4ecae399b000828b02ff69ec3ea4febef (diff)
Definicje wkolo freissego
Diffstat (limited to 'update-pdf.sh')
-rw-r--r--update-pdf.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/update-pdf.sh b/update-pdf.sh
new file mode 100644
index 0000000..8d1534a
--- /dev/null
+++ b/update-pdf.sh
@@ -0,0 +1,24 @@
+if [[ $# != 1 ]]
+then
+ echo "Usage: $0 [.tex file]"
+ exit 1
+fi
+
+PRACA=$1
+if ! [[ -f $PRACA ]]
+then
+ echo "No such file: $PRACA"
+ exit 1
+fi
+
+threshold=1
+while true
+do
+ if (($(date +"%s")- $(stat --format="%Y" $PRACA) < $threshold))
+ then
+ echo "updating"
+ pdflatex $PRACA
+ else
+ sleep 0.2
+ fi
+done