diff options
author | Stephane Peter <megastep@megastep.org> | 2021-05-11 19:15:35 -0700 |
---|---|---|
committer | Stephane Peter <megastep@megastep.org> | 2021-05-11 19:15:35 -0700 |
commit | 17ab4ead81e6e7e652fa96e685f830656e2d1b94 (patch) | |
tree | f2050264eb87d7efde2a2420f49be93310e64dd9 | |
parent | 0838180ca0617df86673a24edd731fe70898cd35 (diff) | |
download | makeself-17ab4ead81e6e7e652fa96e685f830656e2d1b94.tar.gz |
Use $PAGER when displaying builtin license, if any
-rwxr-xr-x | makeself-header.sh | 8 |
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 |