Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] git-latexdiff: new command in contrib, to use latexdiff and Git

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:53:05

Steven Michalske [off-list ref] writes:
On Mac OS X use the open command and the OS will use the correct viewer chosen by the user

open "$pdffile"
Unfortunately, open also exists on my system, but does not do that at
all. I'm squashing this into the next version:
--- a/contrib/latex/git-latexdiff
+++ b/contrib/latex/git-latexdiff
@@ -120,7 +120,13 @@ if [ "$old" = "" ]; then
 fi
 
 verbose "Auto-detecting PDF viewer"
-for command in xdg-open evince okular xpdf acroread; do
+candidates="xdg-open evince okular xpdf acroread"
+if [ "$(uname)" = Darwin ]; then
+    # open exists on GNU/Linux, but does not open PDFs
+    candidates="open $candidates"
+fi
+
+for command in $candidates; do
     if [ "$PDFVIEWER" = "" ]; then
        if command -v "$command" >/dev/null 2>&1; then
            PDFVIEWER="$command"
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help