From f3a447e1c6eada6f90a5ec4861c3aff6cedc4fbe Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 27 Dec 2023 21:38:54 -0500 Subject: [PATCH] don't remove venvs if nocleanup is passed --- check-requirements.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/check-requirements.sh b/check-requirements.sh index 4f7cfcf69..c6341cbbc 100755 --- a/check-requirements.sh +++ b/check-requirements.sh @@ -58,9 +58,12 @@ cleanup() { fi } +do_cleanup=1 if [[ ${1-} == nocleanup ]]; then - shift # discard nocleanup arg -else + do_cleanup=0; shift +fi + +if (( do_cleanup )); then trap exit INT TERM trap cleanup EXIT fi @@ -121,7 +124,9 @@ SourceFileLoader(pyname, py).load_module() EOF ) - rm -rf -- "$venv" + if (( do_cleanup )); then + rm -rf -- "$venv" + fi info "$py: imports OK" } @@ -156,7 +161,9 @@ python3 -m venv "$all_venv" check_requirements requirements.txt ) -rm -rf -- "$all_venv" +if (( do_cleanup )); then + rm -rf -- "$all_venv" +fi check_convert_script convert.py for py in convert-*.py; do