mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-04 13:33:15 +01:00
batman: Fix BAT_PAGER causing infinite recursion
Rather than replacing `BAT_PAGER` with `MANPAGER` every time batman is used, only replace it when batman is called directly (and not used as the MANPAGER).
This commit is contained in:
parent
5011f0709e
commit
205e9c40e1
@ -9,7 +9,6 @@
|
||||
SELF_NC="${BASH_SOURCE:-$0}"
|
||||
SELF="$(cd "$(dirname "${SELF_NC}")" && cd "$(dirname "$(readlink "${SELF_NC}" || echo ".")")" && pwd)/$(basename "$(readlink "${SELF_NC}" || echo "${SELF_NC}")")"
|
||||
LIB="$(cd "$(dirname "${SELF_NC}")" && cd "$(dirname "$(readlink "${SELF_NC}" || echo ".")")/../lib" && pwd)"
|
||||
if [[ -n "${MANPAGER}" ]]; then BAT_PAGER="$MANPAGER"; fi
|
||||
source "${LIB}/constants.sh"
|
||||
source "${LIB}/pager.sh"
|
||||
source "${LIB}/print.sh"
|
||||
@ -65,6 +64,7 @@ if [[ "${BATMAN_IS_BEING_MANPAGER:-}" = "yes" ]]; then
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
if [[ -n "${MANPAGER}" ]]; then BAT_PAGER="$MANPAGER"; fi
|
||||
export MANPAGER="env BATMAN_IS_BEING_MANPAGER=yes bash $(printf "%q " "$SELF" "${FORWARDED_ARGS[@]}")"
|
||||
export MANROFFOPT='-c'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user