README: make fish PATH add conditional on the directory existing (#2786)
This commit is contained in:
parent
2d8bd15ccd
commit
90fa430eca
16
README.md
16
README.md
@ -235,21 +235,21 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
|||||||
<details>
|
<details>
|
||||||
|
|
||||||
1. If you have Fish 3.2.0 or newer, execute this interactively:
|
1. If you have Fish 3.2.0 or newer, execute this interactively:
|
||||||
~~~ fish
|
```fish
|
||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
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:
|
2. Otherwise, execute the snippet below:
|
||||||
~~~ fish
|
```fish
|
||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
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`:
|
3. Now, add this to `~/.config/fish/config.fish`:
|
||||||
~~~ fish
|
```fish
|
||||||
pyenv init - fish | source
|
pyenv init - fish | source
|
||||||
~~~
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### C. Restart your shell
|
### C. Restart your shell
|
||||||
|
Loading…
x
Reference in New Issue
Block a user