X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fpyenv%2Fpyenv.plugin.zsh;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fpyenv%2Fpyenv.plugin.zsh;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=7fbd1589ea77c05f6d795043bbe3456782ab2ada;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/pyenv/pyenv.plugin.zsh b/stow/oh-my-zsh/.oh-my-zsh/plugins/pyenv/pyenv.plugin.zsh deleted file mode 100644 index 7fbd158..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/pyenv/pyenv.plugin.zsh +++ /dev/null @@ -1,98 +0,0 @@ -pyenv_config_warning() { - [[ "$ZSH_PYENV_QUIET" != true ]] || return 0 - - local reason="$1" - local pyenv_root="${PYENV_ROOT/#$HOME/\$HOME}" - cat >&2 </dev/null; then - FOUND_PYENV=0 -elif [[ "${commands[pyenv]}" = */pyenv-win/* && "$(uname -r)" = *icrosoft* ]]; then - FOUND_PYENV=0 -else - FOUND_PYENV=1 -fi - -# Look for pyenv and try to load it (will only work on interactive shells) -if [[ $FOUND_PYENV -ne 1 ]]; then - pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv") - for dir in $pyenvdirs; do - if [[ -d "$dir/bin" ]]; then - FOUND_PYENV=1 - break - fi - done - - if [[ $FOUND_PYENV -ne 1 ]]; then - if (( $+commands[brew] )) && dir=$(brew --prefix pyenv 2>/dev/null); then - if [[ -d "$dir/bin" ]]; then - FOUND_PYENV=1 - fi - fi - fi - - # If we found pyenv, load it but show a caveat about non-interactive shells - if [[ $FOUND_PYENV -eq 1 ]]; then - # Configuring in .zshrc only makes pyenv available for interactive shells - export PYENV_ROOT="$dir" - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init --path)" - - # Show warning due to bad pyenv configuration - pyenv_config_warning 'pyenv command not found in $PATH' - fi -fi - -if [[ $FOUND_PYENV -eq 1 ]]; then - if [[ -z "$PYENV_ROOT" ]]; then - # This is only for backwards compatibility with users that previously relied - # on this plugin exporting it. pyenv itself does not require it to be exported - export PYENV_ROOT="$(pyenv root)" - fi - - # Add pyenv shims to $PATH if not already added - if [[ -z "${path[(Re)$(pyenv root)/shims]}" ]]; then - eval "$(pyenv init --path)" - pyenv_config_warning 'missing pyenv shims in $PATH' - fi - - # Load pyenv - eval "$(pyenv init - --no-rehash zsh)" - - # If pyenv-virtualenv exists, load it - if [[ "$(pyenv commands)" =~ "virtualenv-init" && "$ZSH_PYENV_VIRTUALENV" != false ]]; then - eval "$(pyenv virtualenv-init - zsh)" - fi - - function pyenv_prompt_info() { - local version="$(pyenv version-name)" - echo "${version:gs/%/%%}" - } -else - # Fall back to system python - function pyenv_prompt_info() { - local version="$(python3 -V 2>&1 | cut -d' ' -f2)" - echo "system: ${version:gs/%/%%}" - } -fi - -unset FOUND_PYENV pyenvdirs dir -unfunction pyenv_config_warning