mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-15 01:48:34 -07:00
fix(poetry-env): activate only if env exists (#12301)
This commit is contained in:
parent
ecc3e9db8a
commit
a168efe73e
@ -14,10 +14,10 @@ _togglePoetryShell() {
|
|||||||
# activate the environment if pyproject.toml exists
|
# activate the environment if pyproject.toml exists
|
||||||
if [[ "$poetry_active" != 1 ]]; then
|
if [[ "$poetry_active" != 1 ]]; then
|
||||||
if [[ -f "$PWD/pyproject.toml" ]]; then
|
if [[ -f "$PWD/pyproject.toml" ]]; then
|
||||||
if grep -q 'tool.poetry' "$PWD/pyproject.toml"; then
|
if grep -q 'tool.poetry' "$PWD/pyproject.toml" && venv_dir=$(poetry env info --path); then
|
||||||
export poetry_active=1
|
export poetry_active=1
|
||||||
export poetry_dir="$PWD"
|
export poetry_dir="$PWD"
|
||||||
source "$(poetry env info --path)/bin/activate"
|
source "${venv_dir}/bin/activate"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user