From: Tom Christie Date: Fri, 15 May 2020 12:22:46 +0000 (+0100) Subject: If `scripts/check` fails then prompt and autofix. (#952) X-Git-Tag: 0.13.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51b70b3fca3e787948a7df8dc45a5ee338a71eb4;p=thirdparty%2Fhttpx.git If `scripts/check` fails then prompt and autofix. (#952) * If scripts/check fails then prompt and autofix * Update scripts/test Co-authored-by: Yeray Diaz Diaz * Update test Co-authored-by: Yeray Diaz Diaz --- diff --git a/scripts/test b/scripts/test index 6a4a752f..0ad0157a 100755 --- a/scripts/test +++ b/scripts/test @@ -1,14 +1,24 @@ -#!/bin/sh -e +#!/bin/sh export PREFIX="" if [ -d 'venv' ] ; then export PREFIX="venv/bin/" fi -set -x - if [ -z $GITHUB_ACTIONS ]; then + set +e scripts/check + while [ $? -ne 0 ]; do + read -p "Running 'scripts/check' failed. Do you want to run 'scripts/lint' now? [y/N] " yn + case $yn in + [Yy]* ) :;; + * ) exit;; + esac + scripts/lint + scripts/check + done fi +set -ex + ${PREFIX}pytest $@