mirror of
https://github.com/gaschz/dotfiles.git
synced 2026-01-02 04:24:26 +01:00
fix: remove duplicate pager call
This commit is contained in:
parent
45a0acb222
commit
efe660b3b1
@ -1,30 +1,35 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
## SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
## SPDX-FileCopyrightText: 2023 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||||
##
|
##
|
||||||
## SPDX-License-Identifier: AGPL-3.0-or-later
|
## SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
if command -v delta >/dev/null; then
|
if command -v delta >/dev/null; then
|
||||||
exec delta "${@}"
|
exec delta -- "${@}"
|
||||||
else
|
else
|
||||||
: "${DIFF_HIGHLIGHT_SOURCE:=/usr/share/doc/git/contrib/diff-highlight}"
|
: "${DIFF_HIGHLIGHT_SOURCE:=/usr/share/doc/git/contrib/diff-highlight}"
|
||||||
: "${DIFF_HIGHLIGHT_EXEC:=/usr/share/git-core/contrib/diff-highlight}"
|
: "${DIFF_HIGHLIGHT_EXEC:=/usr/share/git-core/contrib/diff-highlight}"
|
||||||
|
|
||||||
|
git_less(){
|
||||||
|
exec less -RS -- "${@}"
|
||||||
|
}
|
||||||
|
|
||||||
## Debian.
|
## Debian.
|
||||||
if command -v perl >/dev/null &&
|
if command -v perl >/dev/null &&
|
||||||
test -f "${DIFF_HIGHLIGHT_SOURCE}/DiffHighlight.pm" &&
|
test -f "${DIFF_HIGHLIGHT_SOURCE}/DiffHighlight.pm" &&
|
||||||
test -f "${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl"
|
test -f "${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl"
|
||||||
then
|
then
|
||||||
exec perl -I "${DIFF_HIGHLIGHT_SOURCE}" -MDiffHighlight -- \
|
exec perl -I "${DIFF_HIGHLIGHT_SOURCE}" -MDiffHighlight -- \
|
||||||
"${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl" | less -RS
|
"${DIFF_HIGHLIGHT_SOURCE}/diff-highlight.perl" | git_less
|
||||||
|
exit
|
||||||
## Fedora.
|
## Fedora.
|
||||||
elif command -v perl >/dev/null && test -f "${DIFF_HIGHLIGHT_EXEC}"
|
elif command -v perl >/dev/null && test -f "${DIFF_HIGHLIGHT_EXEC}"
|
||||||
then
|
then
|
||||||
exec "${DIFF_HIGHLIGHT_EXEC}" | less -RS
|
exec "${DIFF_HIGHLIGHT_EXEC}" | git_less
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec less -RS "${@}"
|
git_less "${@}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user