README: make fish PATH add conditional on the directory existing (#2786)

This commit is contained in:
Tom Godkin 2025-05-17 14:13:12 +01:00 committed by GitHub
parent 2d8bd15ccd
commit 90fa430eca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -235,21 +235,21 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
<details>
1. If you have Fish 3.2.0 or newer, execute this interactively:
~~~ fish
```fish
set -Ux PYENV_ROOT $HOME/.pyenv
fish_add_path $PYENV_ROOT/bin
~~~
test -d $PYENV_ROOT/bin; and fish_add_path $PYENV_ROOT/bin
```
2. Otherwise, execute the snippet below:
~~~ fish
```fish
set -Ux PYENV_ROOT $HOME/.pyenv
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
~~~
test -d $PYENV_ROOT/bin; and set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
```
3. Now, add this to `~/.config/fish/config.fish`:
~~~ fish
```fish
pyenv init - fish | source
~~~
```
</details>
### C. Restart your shell