This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 7371f986b0eedec677c76dc7b6db28a996b9c525
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Aug 4 15:44:06 2021 +0200

    Add timeout when asking whether to rebuild image (#17412)
    
    This PR adds timeout to answer the question, whether to rebuild
    image when `breeze` is invoked or when pre-commit is run.
    
    This reflects the typical use cases where rebuild is mostly not
    needed, only in case of some tests which require new dependencies
    to be included.
    
    User has still 4 seconds to answer Y and have the images rebuilt
    and just the presence of the question will be enough to get the
    user trigger it from time to time.
    
    (cherry picked from commit 2938acd817561c79674ca333b83ee1972248df98)
---
 confirm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/confirm b/confirm
index e796737..42316da 100755
--- a/confirm
+++ b/confirm
@@ -15,7 +15,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-set -euo pipefail
+set -uo pipefail
 
 if [[ -n "${FORCE_ANSWER_TO_QUESTIONS=}" ]]; then
     RESPONSE=${FORCE_ANSWER_TO_QUESTIONS}
@@ -31,8 +31,8 @@ if [[ -n "${FORCE_ANSWER_TO_QUESTIONS=}" ]]; then
     esac
 else
     echo
-    echo "Please confirm ${1}. Are you sure? [y/N/q]"
-    read -r RESPONSE
+    echo "Please confirm ${1} (or wait 4 seconds to skip it). Are you sure? 
[y/N/q]"
+    read -t 4 -r RESPONSE
 fi
 
 case "${RESPONSE}" in

Reply via email to