comparison .bashrc @ 858:ebfcbbc8a627

only run deactivate iff a function
author Jeff Hammel <k0scist@gmail.com>
date Wed, 11 Apr 2018 10:55:13 -0700
parents 8e41e95aac97
children af998083be84
comparison
equal deleted inserted replaced
857:977b5789cfe8 858:ebfcbbc8a627
607 source ~/.bash_overrides 607 source ~/.bash_overrides
608 608
609 ### deactivate any virtualenvs 609 ### deactivate any virtualenvs
610 if type deactivate &> /dev/null 610 if type deactivate &> /dev/null
611 then 611 then
612 deactivate 612 DEACTIVATE_TYPE=$(type -t deactivate)
613 if [[ ${DEACTIVATE_TYPE} == "function" ]]
614 then
615 deactivate
616 elif [[ ${DEACTIVATE_TYPE} == "file" ]]
617 then
618 . deactivate
619 fi
613 fi 620 fi
614 621
615 622
616 ### source site-specific BASHRC extensions 623 ### source site-specific BASHRC extensions
617 export LOCAL_BASHRC="${HOME}/.bashrc_local" 624 export LOCAL_BASHRC="${HOME}/.bashrc_local"