Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions crates/uv-virtualenv/src/activator/activate
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly

if ! [ -z "${SCRIPT_PATH+_}" ] ; then
_OLD_SCRIPT_PATH="$SCRIPT_PATH"
fi

# Get script path (only used if environment is relocatable).
if [ -n "${BASH_VERSION:+x}" ] ; then
SCRIPT_PATH="${BASH_SOURCE[0]}"
Expand Down Expand Up @@ -80,6 +84,16 @@ if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath
fi
export VIRTUAL_ENV

# Unset the `SCRIPT_PATH` variable, now that the `VIRTUAL_ENV` variable
# has been set. This is important for relocatable environments.
if ! [ -z "${_OLD_SCRIPT_PATH+_}" ] ; then
SCRIPT_PATH="$_OLD_SCRIPT_PATH"
export SCRIPT_PATH
unset _OLD_SCRIPT_PATH
else
unset SCRIPT_PATH
fi

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/{{ BIN_NAME }}:$PATH"
export PATH
Expand Down
Loading