# Ensure we fail the job if any steps fail.
# DO NOT set -u as virtualenv's activate script has unbound variables
-set -e -o pipefail
+set -e +u -o pipefail
# shellcheck source="$WORKSPACE/.jjb.properties" disable=SC1091
source "$WORKSPACE/.jjb.properties"
if [[ -n "$JJB_VENV" && "$JJB_VENV" =~ /tmp/.* ]]; then
- rm -r "$JJB_VENV" && echo "$JJB_VENV removed"
+ rm -rf "$JJB_VENV" && echo "$JJB_VENV removed"
unset JJB_VENV
fi
-rm "$WORKSPACE/.jjb.properties"
+rm -f "$WORKSPACE/.jjb.properties"
+deactivate