Skip to content

Commit 2fe9e01

Browse files
committed
plugins/latex: 2009 was 12 years ago
Locate the currently installed edition, instead of transpoting us back to undergrad.
1 parent b846c86 commit 2fe9e01

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

clean_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ plugins/available/hub.plugin.bash
102102
plugins/available/java.plugin.bash
103103
plugins/available/jekyll.plugin.bash
104104
plugins/available/jump.plugin.bash
105+
plugins/available/latex.plugin.bash
105106
plugins/available/less-pretty-cat.plugin.bash
106107
plugins/available/man.plugin.bash
107108
plugins/available/node.plugin.bash

plugins/available/latex.plugin.bash

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
cite about-plugin
2-
about-plugin 'use mactex'
1+
# shellcheck shell=bash
2+
about-plugin 'add MacTeX to PATH'
3+
4+
_bash_it_plugin_latex_paths=(
5+
# Standard locations
6+
/usr/local/texbin
7+
# MacOS locations
8+
/Library/TeX/texbin
9+
)
310

411
# add mactex to the path if its present
5-
MACTEX_PATH=/usr/local/texlive/2009/bin/universal-darwin
6-
if [[ -d $MACTEX_PATH ]]; then
7-
pathmunge $MACTEX_PATH after
8-
fi
9-
unset MACTEX_PATH
12+
for _bash_it_plugin_latex_path in "${_bash_it_plugin_latex_paths[@]}"; do
13+
if [[ -d "$_bash_it_plugin_latex_path/" ]]; then
14+
pathmunge "$_bash_it_plugin_latex_path" after && break
15+
fi
16+
done
17+
18+
# Cleanup
19+
unset "${!_bash_it_plugin_latex_@}"

0 commit comments

Comments
 (0)