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
|
while [[ "$PWD" != "/" ]]; do
|
||||||
for x in $(fd -HI -td --maxdepth=1); 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"
|
source "${x}/bin/activate"
|
||||||
cd "$init_dir"
|
break 2
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -99,4 +99,6 @@ fi
|
||||||
# Bash completion ====
|
# Bash completion ====
|
||||||
source_completion_scripts
|
source_completion_scripts
|
||||||
|
|
||||||
|
loadvenv
|
||||||
|
|
||||||
# vim: set ft=bash ff=unix:
|
# vim: set ft=bash ff=unix:
|
||||||
|
|
Loading…
Reference in a new issue