Add command-exists shell helper

This commit is contained in:
2020-05-23 19:16:06 +01:00
parent ba559be4bc
commit d4d64f654e
7 changed files with 16 additions and 8 deletions

View File

@@ -5,7 +5,7 @@
alias le="less"
# Enable syntax highlighting via source-highlight
if (( $+commands[src-hilite-lesspipe.sh] )); then
if command-exists "src-hilite-lesspipe.sh"; then
export LESSOPEN="| src-hilite-lesspipe.sh %s"
export LESS=" -R "
elif [ -f "/usr/share/source-highlight/src-hilite-lesspipe.sh" ]; then