From e33b3296545bf07242ba55781477302258b91c81 Mon Sep 17 00:00:00 2001 From: Neal Joslin Date: Thu, 13 Apr 2023 15:23:37 -0400 Subject: [PATCH] Changed workon's env switching to use OR not $? --- virtualenvwrapper.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index cf43626..edd9631 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -759,16 +759,14 @@ function workon { # before switching so we use our override function, # if it exists, but make sure it's the deactivate function # we set up - type deactivate >/dev/null 2>&1 - if [ $? -eq 0 ] - then + ! type deactivate >/dev/null 2>&1 || { typeset -f deactivate | grep 'typeset env_postdeactivate_hook' >/dev/null 2>&1 if [ $? -eq 0 ] then deactivate unset -f deactivate >/dev/null 2>&1 fi - fi + } virtualenvwrapper_run_hook "pre_activate" "$env_name"