changeset 858:ebfcbbc8a627

only run deactivate iff a function
author Jeff Hammel <k0scist@gmail.com>
date Wed, 11 Apr 2018 10:55:13 -0700
parents 977b5789cfe8
children b8510769d001
files .bashrc
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.bashrc	Fri Dec 22 14:11:19 2017 -0800
+++ b/.bashrc	Wed Apr 11 10:55:13 2018 -0700
@@ -609,7 +609,14 @@
 ### deactivate any virtualenvs
 if type deactivate &> /dev/null
 then
-deactivate
+    DEACTIVATE_TYPE=$(type -t deactivate)
+    if [[ ${DEACTIVATE_TYPE} == "function" ]]
+    then
+        deactivate
+    elif [[ ${DEACTIVATE_TYPE} == "file" ]]
+    then
+        . deactivate
+    fi
 fi