Browse Source

Don't move generated PDF file when --output is specified

Moving the PDF file to the toplevel of the temporary directory was needed
for partial cleanup (keeppdf), but a side effect is that it makes
$pdffile absolute, and then breaks abs_pdffile="$PWD/$pdffile". Doing
this file move and make the path name absolute only if --output is not
active fixes the issue.
master
Matthieu Moy 12 years ago
parent
commit
bb301c1c78
  1. 11
      git-latexdiff

11
git-latexdiff

@ -364,17 +364,16 @@ if test "$compile_error" = "1" ; then
exit 1
fi
if [ -f "$pdffile" ]; then
if test -n "$output" ; then
abs_pdffile="$PWD/$pdffile"
(cd "$initial_dir" && mv "$abs_pdffile" "$output")
echo "Output written on $output"
elif [ -f "$pdffile" ]; then
new_pdffile="$tmpdir"/"$pdffile"
mv "$pdffile" "$new_pdffile"
pdffile="$new_pdffile"
fi
if test -n "$output" ; then
abs_pdffile="$PWD/$pdffile"
(cd "$initial_dir" && cp "$abs_pdffile" "$output")
echo "Output written on $output"
fi
if test "$view" = 1 || test "$view" = maybe && test -z "$output" ; then
"$PDFVIEWER" "$pdffile"

Loading…
Cancel
Save