mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-25 22:00:15 +08:00
fix(poetry-env): only run deactivate
if needed (#12701)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
parent
2a109d30af
commit
0987eee190
@ -6,10 +6,11 @@ _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
|
||||
deactivate
|
||||
(( $+functions[deactivate] )) && deactivate
|
||||
fi
|
||||
|
||||
# Activate the environment if in a Poetry directory and no environment is currently active
|
||||
|
Loading…
Reference in New Issue
Block a user