]> git.phdru.name Git - dotfiles.git/commitdiff
.bash_logout: clean up python virtual environment on exit
authorOleg Broytman <phd@phdru.name>
Fri, 29 Jul 2016 15:31:19 +0000 (18:31 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 29 Jul 2016 15:31:19 +0000 (18:31 +0300)
.bash_logout

index de4f5f75d7ccd3a5b62bd2ce683ed678a5cb72c2..4c880fdf932a798ea0162e27409fb023fa4ebe95 100644 (file)
@@ -1,5 +1,10 @@
 # ~/.bash_logout: executed by bash(1) when login shell exits.
 
+# Clean up python virtual environment on exit
+# See https://virtualenvwrapper.readthedocs.io/en/latest/tips.html#clean-up-environments-on-exit
+
+[ "$VIRTUAL_ENV" ] && deactivate
+
 # when leaving the console clear the screen to increase privacy
 
 if [ "$SHLVL" = 1 ]; then