Bash: source venv on startup
This commit is contained in:
parent
02a8705c0a
commit
45118f095e
2 changed files with 4 additions and 3 deletions
|
@ -434,10 +434,9 @@ loadvenv() {
|
|||
|
||||
while [[ "$PWD" != "/" ]]; do
|
||||
for x in $(fd -HI -td --maxdepth=1); do
|
||||
if [[ "$x" == '.venv/' || "$x" == 'venv/' ]]; then
|
||||
if [[ -f "$x/bin/activate" ]]; then
|
||||
source "${x}/bin/activate"
|
||||
cd "$init_dir"
|
||||
return
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -99,4 +99,6 @@ fi
|
|||
# Bash completion ====
|
||||
source_completion_scripts
|
||||
|
||||
loadvenv
|
||||
|
||||
# vim: set ft=bash ff=unix:
|
||||
|
|
Loading…
Reference in a new issue