浏览代码

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

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Kate Sullivan 1 周之前
父节点
当前提交
ca5471fe49
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      plugins/poetry-env/poetry-env.plugin.zsh

+ 1 - 2
plugins/poetry-env/poetry-env.plugin.zsh

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