bash: only export MANPATH if manpath(1) is available

This commit is contained in:
Fernando Schauenburg 2021-07-07 01:18:07 +02:00
parent 3174fc112f
commit e988871cba

View file

@ -23,11 +23,14 @@ export LESSHISTFILE="$XDG_DATA_HOME/less/history"
export LESSHISTSIZE=1000
export LOCAL_CONFIG="$HOME/.local/etc"
export LOCAL_PREFIX="/usr/local"
MANPATH="$(unset MANPATH; manpath)"
export MANPATH
export PAGER=less
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py"
if command -v manpath >/dev/null 2>&1; then
MANPATH="$(unset MANPATH; manpath)"
export MANPATH
fi
# Prevent path_helper from messing with the PATH when starting tmux.
# See: https://superuser.com/a/583502
# shellcheck disable=SC2123 # PATH is being intentionally manipulated here.