Bashrc.wiki: removed code from vactivate section. Just read the source
This commit is contained in:
parent
b4a0f7bf80
commit
95abd74d9c
15
Bashrc.wiki
15
Bashrc.wiki
|
@ -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
|
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"
|
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]].
|
||||||
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]].
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue