Skip to content

Instantly share code, notes, and snippets.

@RHDZMOTA
Last active September 10, 2021 19:17
Show Gist options
  • Save RHDZMOTA/aca6387eb599e2f50a18c14ee9ea3824 to your computer and use it in GitHub Desktop.
Save RHDZMOTA/aca6387eb599e2f50a18c14ee9ea3824 to your computer and use it in GitHub Desktop.
Cross operative system pyenv installer.
manage() {
local command="${1}"
case "${command}" in
install)
case "${OSTYPE}" in
msys)
echo "Installing pyenv-win"
git clone https://github.com/pyenv-win/pyenv-win.git "${HOME}/.pyenv-github"
ln -s "${HOME}/.pyenv-github/pyenv-win" "${HOME}/.pyenv"
;;
*)
echo "Installing pyenv"
git clone https://github.com/pyenv/pyenv.git "${HOME}/.pyenv-github"
ln -s "${HOME}/.pyenv-github" "${HOME}/.pyenv"
;;
esac
;;
update)
echo "Updating pyenv"
(cd "${HOME}/.pyenv-github"; git pull origin master)
;;
esac
}
manage "${@}"
redirect() {
set -e
curl -L https://gist.githubusercontent.com/RHDZMOTA/aca6387eb599e2f50a18c14ee9ea3824/raw/44ff67cad019c1b78de357241448f779d7cc6598/pyenv-manage.sh | bash -s -- install
}
redirect
curl -s -S -L https://gist.githubusercontent.com/RHDZMOTA/aca6387eb599e2f50a18c14ee9ea3824/raw/44ff67cad019c1b78de357241448f779d7cc6598/pyenv-manage.sh | bash -s -- update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment