Thread (8 messages) flat view 8 messages, 5 authors, 2016-06-15

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

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:53:05

Possibly related (same subject, not in this thread)

Matthieu Moy [off-list ref] writes:
Changes since v2:
[...]
- Shell style issues (thanks to Jakub)
[...]
+verbose "Auto-detecting PDF viewer"
+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"
+	else
+	    verbose_progress
+	fi
+    fi
+done
+verbose_done "$PDFVIEWER"
Eh?  I don't see shell style issues fixed (loop inside conditional
instead of vice-versa, "test ..." instead of "[ ... ]").

Nb. I think it would be good to put detecting PDF viewer in its own
function, don't you?

-- 
Jakub Narebski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help