Fix fish installation instructions (#1916)

This commit is contained in:
Fabian Homborg 2021-05-11 21:35:15 +02:00 committed by GitHub
parent fd3c891d76
commit 0d2fb35cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 42 deletions

View file

@ -216,12 +216,20 @@ easy to fork and contribute any changes back upstream.
~~~ ~~~
- For **Fish shell**: - For **Fish shell**:
Execute this interactively:
~~~ fish ~~~ fish
set -Ux PYENV_ROOT $HOME/.pyenv set -Ux PYENV_ROOT $HOME/.pyenv
set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
pyenv init --path | source
~~~ ~~~
And add this to `~/.config/fish/config.fish`:
~~~ fish
status is-login; and pyenv init --path | source
~~~
If fish is not your login shell, also follow the bash/zsh instructions to add to ~/.profile.
- **Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy` too. - **Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy` too.
3. **Add `pyenv init` to your shell** to enable shims and autocompletion. 3. **Add `pyenv init` to your shell** to enable shims and autocompletion.
@ -239,8 +247,9 @@ easy to fork and contribute any changes back upstream.
~~~ ~~~
- For **Fish shell**: - For **Fish shell**:
Add this to `~/.config/fish/config.fish`:
~~~ fish ~~~ fish
echo -e '\n\n# pyenv init\nif command -v pyenv 1>/dev/null 2>&1\n pyenv init - | source\nend' >> ~/.config/fish/config.fish pyenv init - | source
~~~ ~~~
**General warning**: There are some systems where the `BASH_ENV` variable is configured **General warning**: There are some systems where the `BASH_ENV` variable is configured

View file

@ -83,50 +83,49 @@ function help_() {
ksh ) ksh )
profile='~/.profile' profile='~/.profile'
;; ;;
fish )
profile='~/.config/fish/config.fish'
;;
* ) * )
profile='your profile' profile='your profile'
;; ;;
esac esac
{ echo "# Add pyenv executable to PATH by adding" {
echo "# the following to ~/.profile:"
echo
case "$shell" in case "$shell" in
fish ) fish )
echo "# Add pyenv executable to PATH by running"
echo "# the following interactively:"
echo
echo 'set -Ux PYENV_ROOT $HOME/.pyenv' echo 'set -Ux PYENV_ROOT $HOME/.pyenv'
echo 'set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths' echo 'set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths'
;; echo
* ) echo "# Load pyenv automatically by appending"
echo "# the following to ~/.config/fish/config.fish:"
echo
echo 'status is-login; and pyenv init --path | source'
echo 'pyenv init - | source'
echo
echo "# If fish is not your login shell,"
echo "# add the following to ~/.profile:"
echo
echo 'export PYENV_ROOT="$HOME/.pyenv"' echo 'export PYENV_ROOT="$HOME/.pyenv"'
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
echo 'eval "$(pyenv init --path)"'
echo
;; ;;
esac * )
echo "# Add pyenv executable to PATH by adding"
echo "# the following to ~/.profile:"
echo
echo 'export PYENV_ROOT="$HOME/.pyenv"'
echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
echo echo
echo "# Load pyenv automatically by appending" echo "# Load pyenv automatically by appending"
echo "# the following to ${profile}:" echo "# the following to ${profile}:"
echo echo
case "$shell" in
fish )
echo 'pyenv init - | source'
;;
* )
echo 'eval "$(pyenv init -)"' echo 'eval "$(pyenv init -)"'
;;
esac
echo echo
echo "# and the following to ~/.profile:" echo "# and the following to ~/.profile:"
echo echo
case "$shell" in
fish )
echo 'pyenv init --path | source'
;;
* )
echo 'eval "$(pyenv init --path)"' echo 'eval "$(pyenv init --path)"'
;;
esac
echo echo
echo '# If your ~/.profile sources '"${profile}"',' echo '# If your ~/.profile sources '"${profile}"','
echo '# the lines should be inserted before the part' echo '# the lines should be inserted before the part'
@ -135,6 +134,8 @@ function help_() {
echo '# Make sure to restart your entire logon session' echo '# Make sure to restart your entire logon session'
echo '# for changes to ~/.profile to take effect.' echo '# for changes to ~/.profile to take effect.'
echo echo
;;
esac
} >&2 } >&2
} }