File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# SPDX-FileCopyrightText: 2020-2026 David Rabkin
44# SPDX-License-Identifier: 0BSD
55#
6- # shellcheck disable=SC1091 # File not following.
6+ # shellcheck disable=SC2034,SC1091 # Variable appears unused, file not following.
7+ readonly BASE_APP_VERSION=0.9.20260331
78. base.sh
89[ " $# " -eq 1 ] || die tex: try tex [file name]
910isreadable " $1 " || die Unable to read file " $1 " .
@@ -24,6 +25,14 @@ readonly \
2425 NME \
2526 PDF=" $NME " .pdf \
2627 TEX=" $NME " .tex
28+ if cmd_exists -q open; then
29+ OPENER=open
30+ elif cmd_exists -q xdg-open; then
31+ OPENER=xdg-open
32+ else
33+ die Neither open nor xdg-open is available.
34+ fi
35+ readonly OPENER
2736
2837# Do not worry about file cleaning on exit. Garbage collector will remove the
2938# temporarily directory.
@@ -35,4 +44,4 @@ if ! tex --interaction=batchmode "./$TEX" >/dev/null 2>&1; then
3544fi
3645dvipdfm " ./$DVI " > /dev/null 2>&1
3746cp " ./$PDF " " $OLDPWD "
38- open " $OLDPWD /$PDF "
47+ " $OPENER " " $OLDPWD /$PDF "
You can’t perform that action at this time.
0 commit comments