Bashrc.wiki: removed code from vactivate section. Just read the source

This commit is contained in:
David Thurstenson 2021-06-05 18:35:07 -05:00
parent b4a0f7bf80
commit 95abd74d9c
1 changed files with 2 additions and 13 deletions

View File

@ -137,20 +137,9 @@ Sometimes you just need to figure out what font provides a specific character. T
https://git.thurstylark.com/vcsh/bashrc.git/tree/.bashrc.d/vactivate.bash
I started needing more than one python virtualenv, and I wanted easy access to my own specific file structure. Additionally, I wanted the ability to deactivate the venv like I would exit a child shell. This is the solution that I came up with:
I started needing more than one python virtualenv, and I wanted easy access to my own specific file structure. Additionally, I wanted the ability to deactivate the venv like I would exit a child shell. This is the solution that I came up with.
{{{class="prettyprint"
vactivate() {
local path=~/.venv/$1
if [[ ! -d $path ]]; then
python -m venv $path --prompt "venv: $1"
fi
source $path/bin/activate; bash; deactivate
}
}}}
A caveat to this is that the prompt modification that venv usually applies is not available using this method. If a prompt modification is desired, it needs to be taken care of elsewhere. I take care of it in my prompt setup detailed [[https://wiki.thurstylark.com/Bashrc.html#Prompt|here]].
A caveat to this is that the prompt modification that venv usually applies is not available using this method. If a prompt modification is desired, it needs to be taken care of elsewhere. I take care of it in my prompt setup detailed [[https://wiki.thurstylark.com/Bashrc.html#Bashrc-Prompt|here]].
----