Created
September 4, 2015 11:44
-
-
Save hyamamoto/3127ef8ec06eb163c0c4 to your computer and use it in GitHub Desktop.
This script installs `pyenv` to your home directory. (you can set PYENV_ROOT to change the directory, tho.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ ! $(which git) ]; then | |
echo "Git is not installed, can't continue." | |
exit 1 | |
fi | |
if [ -z "${PYENV_ROOT}" ]; then | |
PYENV_ROOT="$HOME/.pyenv" | |
fi | |
# Install pyenv: | |
if [ ! -d "$PYENV_ROOT" ] ; then | |
git clone https://github.com/yyuu/pyenv.git $PYENV_ROOT | |
else | |
cd $PYENV_ROOT | |
if [ ! -d '.git' ]; then | |
git init | |
git remote add origin https://github.com/yyuu/pyenv.git | |
fi | |
git pull origin master | |
fi | |
# Show help if `.pyenv` is not in the path: | |
if [ ! $(which pyenv) ]; then | |
echo " | |
Seems you still have not added 'pyenv' to the load path: | |
# ~/.bash_profile: | |
export PYENV_ROOT=\"\${HOME}/.pyenv\" | |
if [ -d \"\${PYENV_ROOT}\" ]; then | |
export PATH=\"\${PYENV_ROOT}/bin:\${PATH}\" | |
eval \"\$(pyenv init -)\" | |
fi | |
" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment