Prevent user-defined aliases/commands checking

Adding `[ -x ]` also checks if the command is an executable; if this
check is skipped, then user-defined aliases will interfere and validate
the condition (unintended).
This commit is contained in:
anntnzrb 2020-07-05 12:01:13 -05:00
parent 8cba946027
commit 9423c7a66f

View File

@ -32,9 +32,9 @@ case "$ext" in
go) go run "$file" ;;
h) sudo make install ;;
m) octave "$file" ;;
md) if command -v lowdown >/dev/null; then
md) if [ -x "$(command -v lowdown)" ] >/dev/null; then
lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf
elif command -v groffdown >/dev/null; then
elif [ -x "$(command -v groffdown)" ] >/dev/null; then
groffdown -i "$file" | groff > "$base.pdf"
else
pandoc "$file" --pdf-engine=xelatex -o "$base".pdf