lib: Fix regression in pager library

This commit is contained in:
Ethan P 2020-04-30 20:37:01 -07:00
parent 4ee7451532
commit e4d790ca91
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA

View File

@ -37,7 +37,13 @@ pager_version() {
# pager_exec echo hi
pager_exec() {
if [[ -n "$1" ]]; then
"$@" | "${SCRIPT_PAGER_CMD[@]}"
if [[ -n "$SCRIPT_PAGER_CMD" ]]; then
"$@" | "${SCRIPT_PAGER_CMD[@]}" "${SCRIPT_PAGER_ARGS[@]}"
return $?
else
"$@"
return $?
fi
fi
}
@ -47,9 +53,16 @@ pager_exec() {
# bat | pager_display
pager_display() {
if [[ -n "$SCRIPT_PAGER_CMD" ]]; then
"${SCRIPT_PAGER_CMD[@]}" "${SCRIPT_PAGER_ARGS[@]}"
if [[ -n "$SCRIPT_PAGER_CMD" ]]; then
"${SCRIPT_PAGER_CMD[@]}" "${SCRIPT_PAGER_ARGS[@]}"
return $?
else
"${SCRIPT_PAGER_CMD[@]}"
return $?
fi
else
cat
return $?
fi
}