Skip to content

Commit 1fd601d

Browse files
authored
Merge pull request #2007 from gaelicWizard/plugin-latex
Plugin/LaTeX: 2009 was thirteen years ago
2 parents 21e7c1f + 2fe9e01 commit 1fd601d

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
@@ -103,6 +103,7 @@ plugins/available/hub.plugin.bash
103103
plugins/available/java.plugin.bash
104104
plugins/available/jekyll.plugin.bash
105105
plugins/available/jump.plugin.bash
106+
plugins/available/latex.plugin.bash
106107
plugins/available/less-pretty-cat.plugin.bash
107108
plugins/available/man.plugin.bash
108109
plugins/available/nginx.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)