Skip to content

Commit 705e6ec

Browse files
Update MerlinAU.sh
Fine-tuning code to maintain previous behavior of YESorNO prompt except when NO is explicitly provided.
1 parent 32c35d6 commit 705e6ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MerlinAU.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ _WaitForYESorNO_()
318318
local retCode defltAnswer promptStr
319319

320320
if [ $# -gt 0 ] && [ "$1" = "NO" ]
321-
then retCode=1 ; defltAnswer="NO"
322-
else retCode=0 ; defltAnswer="YES"
321+
then retCode=1 ; defltAnswer="YES"
322+
else retCode=0 ; defltAnswer="NO"
323323
fi
324324

325325
! "$isInteractive" && return "$retCode"
@@ -331,6 +331,7 @@ _WaitForYESorNO_()
331331
fi
332332

333333
printf "$promptStr" ; read -r YESorNO
334+
[ -z "$YESorNO" ] && YESorNO="$defltAnswer"
334335
if echo "$YESorNO" | grep -qE "^([Yy](es)?|YES)$"
335336
then echo "OK" ; return 0
336337
else echo "NO" ; return 1

0 commit comments

Comments
 (0)