From 90fa430ecad460d564fc6b4d6ea56eb1ddead20e Mon Sep 17 00:00:00 2001 From: Tom Godkin Date: Sat, 17 May 2025 14:13:12 +0100 Subject: [PATCH] README: make fish PATH add conditional on the directory existing (#2786) --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 134341ea..316cc1b4 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
The Homebrew option from the [MacOS section below](#macos) would also work if you have Homebrew installed. - + ##### 1. Automatic installer (Recommended) ```bash @@ -114,7 +114,7 @@ easy to fork and contribute any changes back upstream. #### MacOS
- + The options from the [Linux section above](#linuxunix) also work but Homebrew is recommended for basic usage. ##### [Homebrew](https://brew.sh) in macOS @@ -229,27 +229,27 @@ See [Advanced configuration](#advanced-configuration) for details and more confi If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
- + #### Fish - +
- + 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 - ~~~ + ```
### C. Restart your shell