diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2018-07-18 16:11:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 16:11:37 +0300 |
commit | afcb1b7f84466898c632f47a75d7f1cdf5334f13 (patch) | |
tree | 850aadf3048e38603c664ae84af6f12ea3494af9 /powerlevel9k.zsh-theme | |
parent | 22a761208d24027a26daa947a7b4034365fefc16 (diff) | |
parent | cff11d2e82a216b6764a07cfd5a1f9d0f06b753b (diff) |
Merge pull request #916 from AlexaraWu/patch/pyenv
Additional fix to `pyenv` segment
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 3e425c48..e2259897 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1634,7 +1634,11 @@ prompt_pyenv() { "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$PYENV_VERSION" 'PYTHON_ICON' elif [ $commands[pyenv] ]; then local pyenv_version_name="$(pyenv version-name)" - local pyenv_global="$(pyenv version-file-read $(pyenv root)/version)" + local pyenv_global="system" + local pyenv_root="$(pyenv root)" + if [[ -f "${pyenv_root}/version" ]]; then + pyenv_global="$(pyenv version-file-read ${pyenv_root}/version)" + fi if [[ "${pyenv_version_name}" != "${pyenv_global}" || "${POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version_name" 'PYTHON_ICON' fi |