diff --git a/git-latexdiff b/git-latexdiff index b0e233d..3bb7ed1 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -568,13 +568,6 @@ fi mainbase=$(basename "$main" .tex) 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.$$ mkdir "$tmpdir" || die "Cannot create temporary directory." @@ -601,8 +594,20 @@ fi if test "$subtree" = 1 && test -n "$git_prefix"; then 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 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 # Checkout a subtree, without touching the index ("git checkout" would) @@ -799,9 +804,7 @@ pdffile="$builddir/$mainbase".pdf if test ! -r "$pdffile" ; then echo "No PDF file generated." compile_error=1 -fi - -if test ! -s "$pdffile" ; then +elif test ! -s "$pdffile" ; then echo "PDF file generated is empty." compile_error=1 fi