mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Added option for POWERLINE_ENV_NAME to override VIRTUAL_ENV
This commit is contained in:
parent
a9b8c9bb39
commit
9876bd7ed3
|
|
@ -7,9 +7,14 @@ class Segment(BasicSegment):
|
|||
env = os.getenv('VIRTUAL_ENV') \
|
||||
or os.getenv('CONDA_ENV_PATH') \
|
||||
or os.getenv('CONDA_DEFAULT_ENV')
|
||||
|
||||
if os.getenv('VIRTUAL_ENV') \
|
||||
and os.path.basename(env) == '.venv':
|
||||
env = os.path.basename(os.path.dirname(env))
|
||||
|
||||
if os.getenv('POWERLINE_ENV_NAME'):
|
||||
env = os.getenv('POWERLINE_ENV_NAME')
|
||||
|
||||
if not env:
|
||||
return
|
||||
env_name = os.path.basename(env)
|
||||
|
|
|
|||
Loading…
Reference in a new issue