FIX: Y/n prompt should treat "no value" as yes

This commit is contained in:
Michael Brown 2023-11-30 15:05:16 -05:00
parent e06026b97c
commit 1f33e0ad55
No known key found for this signature in database
GPG Key ID: 6C07FB3007CF9360
1 changed files with 8 additions and 7 deletions

View File

@ -314,18 +314,19 @@ print_done() {
log "==================== DONE! ===================="
DOCTOR_FILE=$(date +%s | sha256sum | base64 | head -c 20).txt
if [ $app_name == 'app' ] && [ "$NO_CONTAINER" != 'y' ]
then
read -p "Would you like to serve a publicly available version of this file? (Y/n)" serve
if [ $serve == 'Y' ]
then
if [ $app_name == 'app' ] && [ "$NO_CONTAINER" != 'y' ]; then
read -p "Would you like to serve a publicly available version of this file? (Y/n) " serve
case "${serve:-Y}" in
y*|Y*)
cp $LOG_FILE shared/standalone/log/var-log/$DOCTOR_FILE
sudo docker exec -w /var/www/discourse -i $app_name cp /var/log/$DOCTOR_FILE public
log "The output of this program may be available at http://$DISCOURSE_HOSTNAME/$DOCTOR_FILE"
log "You should inspect that file carefully before sharing the URL."
else
;;
*)
log "Publicly available log not generated."
fi
;;
esac
fi
# The following is not in the web log file since it was copied above, which seems correct
log