2020-06-28 21:44:40 +03:00
|
|
|
function _tide_item_virtual_env
|
2020-09-08 17:43:51 +03:00
|
|
|
if set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV")
|
2020-08-25 02:56:02 +03:00
|
|
|
set_color $tide_virtual_env_color
|
2021-03-01 02:37:19 +03:00
|
|
|
# Avoid printing a generic name
|
|
|
|
if contains -- $splitVirtualEnv[-1] virtualenv venv .venv env
|
2020-09-08 17:43:51 +03:00
|
|
|
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-2]
|
2021-03-01 02:37:19 +03:00
|
|
|
else
|
|
|
|
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-1]
|
2020-06-28 21:44:40 +03:00
|
|
|
end
|
|
|
|
end
|
2021-03-02 20:46:40 +03:00
|
|
|
end
|