Skip to content

Commit 41f59d1

Browse files
Add option to say yes
1 parent 49bbc1e commit 41f59d1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

update.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ show_help() {
3838
info "-s skip actual build steps (Default off)"
3939
info "-r only build release (Default off)"
4040
info "-t build tests (Default off)"
41+
info "-y say yes"
4142

4243
header "Workflow Options - only one of the below at a time"
4344
info "-d Developer Workflow: (Default) Building the current branch Qt+Chromium"
@@ -90,6 +91,9 @@ BUILD_RELEASE=false
9091
# t) Build tests
9192
BUILD_TESTS=false
9293

94+
# y) Say yes
95+
SAY_YES=false
96+
9397
# 4) Root work directory (WORK_DIR)
9498
if [ "$OSTYPE" = "msys" ] ; then
9599
WORK_DIR="/c/Code"
@@ -102,7 +106,7 @@ fi
102106
# Process commandline
103107
OPTIND=1
104108

105-
while getopts "h?vkxsrtj:w:dupeqcli" opt; do
109+
while getopts "h?vkxsyrtj:w:dupeqcli" opt; do
106110
case "$opt" in
107111
h|\?)
108112
show_help
@@ -136,6 +140,8 @@ while getopts "h?vkxsrtj:w:dupeqcli" opt; do
136140
;;
137141
s) BUILD_SKIP=true
138142
;;
143+
y) SAY_YES=true
144+
;;
139145
j) BUILD_JOBS=$OPTARG
140146
;;
141147
w) WORK_DIR=$OPTARG
@@ -242,7 +248,12 @@ else
242248
fi
243249

244250
confirm() {
245-
read -r -p "${1:-Are you sure? [y/N]} " response
251+
if [ "$SAY_YES" = true ] ; then
252+
response="y"
253+
else
254+
read -r -p "${1:-Are you sure? [y/N]} " response
255+
fi
256+
246257
case "$response" in
247258
[yY][eE][sS]|[yY])
248259
true

0 commit comments

Comments
 (0)