]> git.phdru.name Git - dotfiles.git/commitdiff
Refactor(.bashrc): Reorder parts
authorOleg Broytman <phd@phdru.name>
Thu, 16 Nov 2023 13:54:25 +0000 (16:54 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 30 Nov 2023 20:27:44 +0000 (23:27 +0300)
.bashrc

diff --git a/.bashrc b/.bashrc
index 1350fcd020dfd1fe2b7af017078cece4aadb213d..8c05ad26d5155c59cb452177b160c0db87364f96 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -32,10 +32,10 @@ esac
 
 . "$HOME"/.shellrc
 
+# This is the default value set by interactive bash
+# when the global value was unset. Unset it here too.
 if [ "$HISTFILE" = "$HOME/.bash_history" ]; then
     history -r
-    # This is the default value set by interactive bash
-    # when the global value was unset. Unset it here too.
     unset HISTFILE
 fi
 
@@ -164,6 +164,15 @@ complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser
 
 if [ -n "$VIRTUAL_ENV" ] && ! type deactivate >/dev/null 2>&1; then
     . "$VIRTUAL_ENV/bin/activate"
+fi
+
+# Clean up python virtual environment on exit
+# See https://virtualenvwrapper.readthedocs.io/en/latest/tips.html#clean-up-environments-on-exit
+
+trap '[ "$VIRTUAL_ENV" ] && deactivate' EXIT
+
+. virtualenvwrapper_lazy.sh 2>/dev/null
+
 
 if test -d "$HOME"/.pyenv
 then
@@ -178,18 +187,6 @@ then
 fi
 
 
-if [ -n "$VIRTUAL_ENV" ] && ! type deactivate >/dev/null 2>&1; then
-    . "$VIRTUAL_ENV/bin/activate"
-fi
-
-# Clean up python virtual environment on exit
-# See https://virtualenvwrapper.readthedocs.io/en/latest/tips.html#clean-up-environments-on-exit
-
-trap '[ "$VIRTUAL_ENV" ] && deactivate' EXIT
-
-. virtualenvwrapper_lazy.sh 2>/dev/null
-
-
 if test -x /usr/bin/screen >/dev/null 2>&1; then
     screen_newwin() {
         history -a