1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-14 18:00:08 +00:00

fix(poetry-env): switch venv between poetry dirs (#12804)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
Kate Sullivan 2024-11-14 02:00:48 -06:00 committed by GitHub
parent 7ed475cb58
commit ca5471fe49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,8 +6,7 @@ _togglePoetryShell() {
fi
# Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory
if [[ $poetry_active -eq 1 ]] && [[ $in_poetry_dir -eq 0 ]] \
&& [[ "$PWD" != "$poetry_dir"* ]]; then
if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] || [[ "$PWD" != "$poetry_dir"* ]]; }; then
export poetry_active=0
unset poetry_dir
(( $+functions[deactivate] )) && deactivate