Browse Source

Merge branch 'fix-builddir' into 'master'

Fix builddir when main is in a subdirectory

See merge request git-latexdiff/git-latexdiff!13
master
Matthieu Moy 6 years ago
parent
commit
5b289b33f7
  1. 23
      git-latexdiff

23
git-latexdiff

@ -568,13 +568,6 @@ fi
mainbase=$(basename "$main" .tex) mainbase=$(basename "$main" .tex)
maindir=$(dirname "$main") maindir=$(dirname "$main")
# create the build directory (containing the final PDFs) if the param was set
if test -n "$use_build_dir" ; then
builddir="$maindir/$use_build_dir"
else
builddir="$maindir"
fi
tmpdir=$tmpdir_prefix/git-latexdiff.$$ tmpdir=$tmpdir_prefix/git-latexdiff.$$
mkdir "$tmpdir" || die "Cannot create temporary directory." mkdir "$tmpdir" || die "Cannot create temporary directory."
@ -601,8 +594,20 @@ fi
if test "$subtree" = 1 && test -n "$git_prefix"; then if test "$subtree" = 1 && test -n "$git_prefix"; then
checkoutroot=$git_prefix checkoutroot=$git_prefix
# create the build directory (containing the final PDFs) if the param was set
if test -n "$use_build_dir" ; then
builddir="$use_build_dir"
else
builddir="."
fi
else else
checkoutroot="." checkoutroot="."
# create the build directory (containing the final PDFs) if the param was set
if test -n "$use_build_dir" ; then
builddir="$git_prefix/$use_build_dir"
else
builddir="$git_prefix"
fi
fi fi
# Checkout a subtree, without touching the index ("git checkout" would) # Checkout a subtree, without touching the index ("git checkout" would)
@ -799,9 +804,7 @@ pdffile="$builddir/$mainbase".pdf
if test ! -r "$pdffile" ; then if test ! -r "$pdffile" ; then
echo "No PDF file generated." echo "No PDF file generated."
compile_error=1 compile_error=1
fi
if test ! -s "$pdffile" ; then
elif test ! -s "$pdffile" ; then
echo "PDF file generated is empty." echo "PDF file generated is empty."
compile_error=1 compile_error=1
fi fi

Loading…
Cancel
Save