From 46c5d79bffe5985e51e33f2b68c88f032ffb7730 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:28:57 +0000 Subject: [PATCH] fix: prevent resetting VIRTUAL_ENV Fixes https://github.com/jdx/mise/issues/2571 --- bin/exec-env | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/exec-env b/bin/exec-env index 967a6b3..aa13adb 100755 --- a/bin/exec-env +++ b/bin/exec-env @@ -12,7 +12,7 @@ setup_virtualenv() { fi set +e - VIRTUAL_ENV="$(poetry_venv)" + venv="$(poetry_venv)" poetry_venv_exit_code=$? set -e @@ -20,17 +20,17 @@ setup_virtualenv() { return fi - if [[ ! -d "$VIRTUAL_ENV" ]]; then + if [[ ! -d "$venv" ]]; then if [[ "${MISE_POETRY_AUTO_INSTALL:-}" != "true" ]] && [[ "${MISE_POETRY_AUTO_INSTALL:-}" != "1" ]]; then return fi poetry_bin install - VIRTUAL_ENV="$(poetry_bin env info --path)" + venv="$(poetry_bin env info --path)" fi POETRY_ACTIVE=1 - MISE_ADD_PATH="$VIRTUAL_ENV/bin" - export VIRTUAL_ENV POETRY_ACTIVE MISE_ADD_PATH + MISE_ADD_PATH="$venv/bin" + export VIRTUAL_ENV="$venv" POETRY_ACTIVE MISE_ADD_PATH } setup_virtualenv