1
0
mirror of https://gitlab.com/ceda_ei/wish synced 2025-04-01 22:06:53 +02:00

Use parent directory name if the pwd is .venv

This commit is contained in:
Ceda EI 2021-02-14 16:31:18 +05:30
parent 4b9c2b6982
commit 61ade4610c

View File

@ -13,7 +13,7 @@ function wish_python_venv_set_colors() {
function wish_python_venv_main() {
if [[ -v VIRTUAL_ENV ]]; then
local venv=$(echo $VIRTUAL_ENV | sed 's|.*/||')
local venv=$(echo $VIRTUAL_ENV | sed ';s|/.venv$||;s|.*/||')
wish_append $WISH_PYTHON_VENV_BG $WISH_PYTHON_VENV_FG " $venv "
else
wish_append $WISH_PYTHON_VENV_BG $WISH_PYTHON_VENV_FG ""