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 <yeraydiazdiaz@gmail.com>

* Update test

Co-authored-by: Yeray Diaz Diaz <yeraydiazdiaz@gmail.com>
This commit is contained in:
Tom Christie 2020-05-15 13:22:46 +01:00 committed by GitHub
parent 790a3ead5d
commit 51b70b3fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 $@