projects
/
shutils.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05ceecf
)
git: update pre-commit-texcheck
author
Stefan Huber <shuber@sthu.org>
Mon, 13 Jan 2014 09:47:52 +0000
(10:47 +0100)
committer
Stefan Huber <shuber@sthu.org>
Mon, 13 Jan 2014 09:47:52 +0000
(10:47 +0100)
Change working directory if tex file is in a sub-directory.
git/pre-commit-texcheck
patch
|
blob
|
history
diff --git
a/git/pre-commit-texcheck
b/git/pre-commit-texcheck
index 29547feaf9464894aac500d0e39a7a425162218f..dae2418a129913c5bee48a49fa847894814bd6d7 100755
(executable)
--- a/
git/pre-commit-texcheck
+++ b/
git/pre-commit-texcheck
@@
-14,11
+14,16
@@
for f in $(find -name "*.tex"); do
# Only main tex files are interesting
grep -q "\documentclass" "$f" || continue
- if ! pdflatex -output-directory "$tmpdir" $f < /dev/null > /dev/null; then
+ pushd .
+ cd $(dirname $f)
+
+ if ! pdflatex -output-directory "$tmpdir" $(basename $f) < /dev/null > /dev/null; then
+ popd
echo >&2 "pdflatex failed on '$f'."
cleanup
exit 1
fi
+ popd
done
cleanup