don't remove venvs if nocleanup is passed

This commit is contained in:
Jared Van Bortel 2023-12-27 21:38:54 -05:00
parent d0ab7a1dc6
commit f3a447e1c6

View file

@ -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
)
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
)
if (( do_cleanup )); then
rm -rf -- "$all_venv"
fi
check_convert_script convert.py
for py in convert-*.py; do