mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Allow subdirectories to have their own .venv setting
This commit is contained in:
parent
8c93142b13
commit
e642856e18
1 changed files with 4 additions and 2 deletions
|
|
@ -15,9 +15,11 @@ if (( $+commands[$virtualenvwrapper] )); then
|
|||
PROJECT_ROOT="."
|
||||
fi
|
||||
# Check for virtualenv name override
|
||||
if [[ -f "$PROJECT_ROOT/.venv" ]]; then
|
||||
if [[ -f "$PWD/.venv" && $PWD = $PROJECT_ROOT/* ]]; then
|
||||
ENV_NAME=`cat "$PWD/.venv"`
|
||||
elif [[ -f "$PROJECT_ROOT/.venv" ]]; then
|
||||
ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
|
||||
elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then
|
||||
elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]]; then
|
||||
ENV_NAME="$PROJECT_ROOT/.venv"
|
||||
elif [[ "$PROJECT_ROOT" != "." ]]; then
|
||||
ENV_NAME=`basename "$PROJECT_ROOT"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue