Skip to content

Commit 5721546

Browse files
committed
Pyenv: Only install if it was not yet installed
1 parent ac4d614 commit 5721546

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

scripts/install-dependencies.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@ else
2323
fi
2424

2525
echo "Installing Pyenv"
26-
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
27-
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.bashrc
28-
echo 'export PATH="${PYENV_ROOT}/bin:${PATH}"' >> ~/.bashrc
29-
git clone https://github.com/pyenv/pyenv-virtualenv.git ${HOME}/.pyenv/plugins/pyenv-virtualenv
26+
if [ ! -d "${HOME}/.pyenv" ] && [ -n "${PYENV_ROOT-}" ]; then
27+
git clone https://github.com/pyenv/pyenv.git ${HOME}/.pyenv
28+
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ${HOME}/.bashrc
29+
echo 'export PATH="${PYENV_ROOT}/bin:${PATH}"' >> ${HOME}/.bashrc
30+
else
31+
echo "Pyenv is already installed"
32+
fi
33+
34+
echo "Installing Pyenv virtualenv plugin"
35+
if [ ! -d "${HOME}/.pyenv/plugins/pyenv-virtualenv" ]; then
36+
git clone https://github.com/pyenv/pyenv-virtualenv.git ${HOME}/.pyenv/plugins/pyenv-virtualenv
37+
else
38+
echo "Pyenv virtualenv plugin is already installed"
39+
fi
3040

3141
echo "Installing Pyenv's dependencies"
3242
if [[ ! -z $(which yum) ]]; then

0 commit comments

Comments
 (0)