From 5a1499672e274784c658e44854b4cff7fdd9078a Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 8 Oct 2024 21:41:31 +0200 Subject: [PATCH] ensure deactivate is present --- plugins/poetry-env/poetry-env.plugin.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index f27c4cbb9..dd52b1655 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -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 2>/dev/null + (( $+functions[deactivate] )) && deactivate fi # Activate the environment if in a Poetry directory and no environment is currently active