portfolio/latex_watch.sh

21 lines
488 B
Bash

#!/bin/sh
mkdir latex_build
[ -v $TARGET_LOCALE ] && TARGET_LOCALE=fr
SOURCE=latex_build/resume_$TARGET_LOCALE.tex
compile() {
curl http://localhost:8001/latex-resume --header "Accept-Language: $TARGET_LOCALE" > $SOURCE
pdflatex --output-directory=latex_build -halt-on-error -shell-escape $SOURCE
echo "Compilation attempt for locale $TARGET_LOCALE terminated"
}
compile
while :
do
inotifywait -e modify templates/cv.tex
echo "file has changed"
compile
done