Include a Bash automated install option

This commit is contained in:
Ivan Pozdeev 2021-05-12 23:05:07 +03:00
parent 0d07cda969
commit e0d109c227
2 changed files with 16 additions and 1 deletions

View file

@ -243,6 +243,21 @@ easy to fork and contribute any changes back upstream.
eval "$(pyenv init --path)" 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, **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`. e.g. by copying them there or by `source`'ing `~/.profile`.

View file

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