mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-04 21:40:44 +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_NC="${BASH_SOURCE:-$0}"
|
||||||
SELF="$(cd "$(dirname "${SELF_NC}")" && cd "$(dirname "$(readlink "${SELF_NC}" || echo ".")")" && pwd)/$(basename "$(readlink "${SELF_NC}" || echo "${SELF_NC}")")"
|
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)"
|
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}/constants.sh"
|
||||||
source "${LIB}/pager.sh"
|
source "${LIB}/pager.sh"
|
||||||
source "${LIB}/print.sh"
|
source "${LIB}/print.sh"
|
||||||
@ -65,6 +64,7 @@ if [[ "${BATMAN_IS_BEING_MANPAGER:-}" = "yes" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
if [[ -n "${MANPAGER}" ]]; then BAT_PAGER="$MANPAGER"; fi
|
||||||
export MANPAGER="env BATMAN_IS_BEING_MANPAGER=yes bash $(printf "%q " "$SELF" "${FORWARDED_ARGS[@]}")"
|
export MANPAGER="env BATMAN_IS_BEING_MANPAGER=yes bash $(printf "%q " "$SELF" "${FORWARDED_ARGS[@]}")"
|
||||||
export MANROFFOPT='-c'
|
export MANROFFOPT='-c'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user