summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Peter <megastep@megastep.org>2021-05-11 19:15:35 -0700
committerStephane Peter <megastep@megastep.org>2021-05-11 19:15:35 -0700
commit17ab4ead81e6e7e652fa96e685f830656e2d1b94 (patch)
treef2050264eb87d7efde2a2420f49be93310e64dd9
parent0838180ca0617df86673a24edd731fe70898cd35 (diff)
downloadmakeself-17ab4ead81e6e7e652fa96e685f830656e2d1b94.tar.gz
Use $PAGER when displaying builtin license, if any
-rwxr-xr-xmakeself-header.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/makeself-header.sh b/makeself-header.sh
index 1edc4ac..e13eea4 100755
--- a/makeself-header.sh
+++ b/makeself-header.sh
@@ -64,11 +64,13 @@ MS_Printf()
MS_PrintLicense()
{
+ PAGER=\${PAGER:=more}
if test x"\$licensetxt" != x; then
- if test x"\$accept" = xy; then
- echo "\$licensetxt"
+ PAGER_PATH=\`exec <&- 2>&-; which \$PAGER || command -v \$PAGER || type \$PAGER\`
+ if test -x "\$PAGER_PATH"; then
+ echo "\$licensetxt" | \$PAGER
else
- echo "\$licensetxt" | more
+ echo "\$licensetxt"
fi
if test x"\$accept" != xy; then
while true