From 6358cbe01f6cbd24c2dba9514355ce77e4f4a742 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sun, 21 Dec 2025 03:07:02 +0300 Subject: [PATCH] Alter startup code to conform to others [no ci] --- README.md | 3 ++- libexec/pyenv-init | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c19edced..7abfd014 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,8 @@ See [Advanced configuration](#advanced-configuration) for details and more confi ~~~ pwsh echo '$Env:PYENV_ROOT="$Env:HOME/.pyenv"' >> $profile.CurrentUserAllHosts - echo '$Env:PATH="$Env:PYENV_ROOT/bin:$Env:PATH"' >> $profile.CurrentUserAllHosts + echo 'if (Test-Path -LP "$Env:PYENV_ROOT/bin" -PathType Container) { + $Env:PATH="$Env:PYENV_ROOT/bin:$Env:PATH" }' >> $profile.CurrentUserAllHosts echo 'iex ((pyenv init -) -join "`n")' >> $profile.CurrentUserAllHosts ~~~ diff --git a/libexec/pyenv-init b/libexec/pyenv-init index b5c9aa61..a9f30c1b 100755 --- a/libexec/pyenv-init +++ b/libexec/pyenv-init @@ -160,7 +160,8 @@ function help_() { echo "# the following to $profile :" echo echo '$Env:PYENV_ROOT="$Env:HOME/.pyenv"' - echo '$Env:PATH="$Env:PYENV_ROOT/bin:$Env:PATH"' + echo 'if (Test-Path -LP "$Env:PYENV_ROOT/bin" -PathType Container) {' + echo ' $Env:PATH="$Env:PYENV_ROOT/bin:$Env:PATH" }' echo 'iex ((pyenv init -) -join "`n")' ;; * )