Quellcode durchsuchen

Bash automated install option (#1922)

Bash automated install option for the case when ~/.profile sources ~/.bashrc
pull/1928/head
native-api vor 5 Jahren
committed von GitHub
Ursprung
Commit
bba1289e23
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 16 neuen und 1 gelöschten Zeilen
  1. +15
    -0
      README.md
  2. +1
    -1
      libexec/pyenv-init

+ 15
- 0
README.md Datei anzeigen

@ -243,6 +243,21 @@ easy to fork and contribute any changes back upstream.
eval "$(pyenv init --path)"
~~~
<!--This is an alternative option and needn't be replicated to `pyenv init`-->
Alternatively, for an automated installation, you can run the following:
~~~ bash
echo -e 'if shopt -q login_shell; then' \
'\n export PYENV_ROOT="$HOME/.pyenv"' \
'\n export PATH="$PYENV_ROOT/bin:$PATH"' \
'\n eval "$(pyenv init --path)"' \
'\nfi' >> ~/.bashrc
echo -e 'if [ -z "$BASH_VERSION" ]; then'\
'\n export PYENV_ROOT="$HOME/.pyenv"'\
'\n export PATH="$PYENV_ROOT/bin:$PATH"'\
'\n eval "$(pyenv init --path)"'\
'\nfi' >>~/.profile
~~~
**Note:** If you have `~/.bash_profile`, make sure that it too executes the above-added commands,
e.g. by copying them there or by `source`'ing `~/.profile`.

+ 1
- 1
libexec/pyenv-init Datei anzeigen

@ -139,7 +139,7 @@ function help_() {
if [[ $shell == "bash" ]]; then
echo '# If your ~/.profile sources '"${rc}"','
echo '# the lines need to be inserted before the part'
echo '# that does that.'
echo '# that does that. See the README for another option.'
echo
echo '# If you have '"${profile}"', make sure that it'
echo '# also executes the above lines -- e.g. by'

Laden…
Abbrechen
Speichern