aboutsummaryrefslogtreecommitdiff
path: root/update-pdf.sh
blob: f3420795d7f26d703538ccd37a871bcc99fd39ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
    biber $PARACA
    pdflatex $PRACA
    pdflatex $PRACA
  else
    sleep 0.2
  fi
done