From 9afdb20dc582f94cce88b2f85539229de8459d9f Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Sun, 9 Apr 2023 01:29:19 +0100 Subject: [PATCH] build: skip confirm if non-interactive --- build.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index 643f7e7..91b287e 100755 --- a/build.sh +++ b/build.sh @@ -29,17 +29,19 @@ img_version=$godot_branch-$base_distro files_root="$(cd dirname "$0"; pwd)/files" build_msvc=0 -# Confirm settings -echo "Docker image tag: ${img_version}" -echo -while true; do - read -p "Is this correct? [y/n] " yn - case $yn in - [Yy]* ) break;; - [Nn]* ) exit 1;; - * ) echo "Please answer yes or no.";; - esac -done +if [ ! -z "$PS1" ]; then + # Confirm settings + echo "Docker image tag: ${img_version}" + echo + while true; do + read -p "Is this correct? [y/n] " yn + case $yn in + [Yy]* ) break;; + [Nn]* ) exit 1;; + * ) echo "Please answer yes or no.";; + esac + done +fi mkdir -p logs