ensure deactivate is present

This commit is contained in:
Carlo Sala 2024-10-08 21:41:31 +02:00
commit 5a1499672e
No known key found for this signature in database
GPG key ID: DA6FB450C1A4FE9A

View file

@ -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