Prevent user-defined aliases/commands checking (#748)

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 15:17:49 -05:00 committed by GitHub
parent 8cba946027
commit 53cdc0eb95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,9 +32,9 @@ case "$ext" in
go) go run "$file" ;; go) go run "$file" ;;
h) sudo make install ;; h) sudo make install ;;
m) octave "$file" ;; 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 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" groffdown -i "$file" | groff > "$base.pdf"
else else
pandoc "$file" --pdf-engine=xelatex -o "$base".pdf pandoc "$file" --pdf-engine=xelatex -o "$base".pdf