summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@tsaousis.gr>2017-06-14 00:21:00 +0300
committerStéphane Peter <megastep@megastep.org>2017-06-13 14:21:00 -0700
commit0f781a303ba98b44fed2b21098273f404b30de79 (patch)
tree540492792aae0069ab8aa0b4a6d2d35957b7e622
parentd7b5a6a34ebc2e5b8364a815ad734974afe4ffb9 (diff)
downloadmakeself-0f781a303ba98b44fed2b21098273f404b30de79.tar.gz
allow the users to accept the license from the command line - usefull in automated scripts (#100)
-rwxr-xr-xmakeself-header.sh32
1 files changed, 20 insertions, 12 deletions
diff --git a/makeself-header.sh b/makeself-header.sh
index 2d6f287..93d937b 100755
--- a/makeself-header.sh
+++ b/makeself-header.sh
@@ -22,6 +22,7 @@ filesizes="$filesizes"
keep="$KEEP"
nooverwrite="$NOOVERWRITE"
quiet="n"
+accept="n"
nodiskspace="n"
export_conf="$EXPORT_CONF"
@@ -50,18 +51,20 @@ MS_PrintLicense()
{
if test x"\$licensetxt" != x; then
echo "\$licensetxt"
- while true
- do
- MS_Printf "Please type y to accept, n otherwise: "
- read yn
- if test x"\$yn" = xn; then
- keep=n
- eval \$finish; exit 1
- break;
- elif test x"\$yn" = xy; then
- break;
- fi
- done
+ if test x"\$accept" != xy; then
+ while true
+ do
+ MS_Printf "Please type y to accept, n otherwise: "
+ read yn
+ if test x"\$yn" = xn; then
+ keep=n
+ eval \$finish; exit 1
+ break;
+ elif test x"\$yn" = xy; then
+ break;
+ fi
+ done
+ fi
fi
}
@@ -141,6 +144,7 @@ MS_Help()
with following options (in that order)
--confirm Ask before running embedded script
--quiet Do not print anything except error messages
+ --accept Accept the license
--noexec Do not run embedded script
--keep Do not erase target directory after running
the embedded script
@@ -243,6 +247,10 @@ do
noprogress=y
shift
;;
+ --accept)
+ accept=y
+ shift
+ ;;
--info)
echo Identification: "\$label"
echo Target directory: "\$targetdir"