diff --git a/tools/_release.sh b/tools/_release.sh index 208c42a6f..95f722f00 100755 --- a/tools/_release.sh +++ b/tools/_release.sh @@ -30,6 +30,18 @@ echo Releasing production version "$version"... nextversion="$2" RELEASE_BRANCH="candidate-$version" +if [ -n "$VIRTUAL_ENV" ]; then + if [[ "$PATH" != $VIRTUAL_ENV* ]]; then + echo "Unexpected PATH and VIRTUAL_ENV value. Please deactivate any" + echo "Python virtual environments and try running this script again." + exit 1 + fi + echo "Deactivating venv..." + export PATH="${PATH#*:}" + hash -r 2> /dev/null + unset VIRTUAL_ENV +fi + if [ "$(git branch --show-current)" != "$RELEASE_BRANCH" ]; then echo "Creating $RELEASE_BRANCH branch..." git switch -c "$RELEASE_BRANCH"