Skip to content

Commit

Permalink
Add an ability to install a specific version of pyenv (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
cavcrosby authored May 1, 2022
1 parent 771de8e commit 49fba59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Once prerequisites have been installed correctly:

Install:
~~~~
If you wish to install a specific release of Pyenv rather than the latest head, set the ``PYENV_GIT_TAG`` environment variable (e.g. ``export PYENV_GIT_TAG=v2.2.5``).

.. code:: bash
curl https://pyenv.run | bash
Expand Down
14 changes: 7 additions & 7 deletions bin/pyenv-installer
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ failed_checkout() {
}

checkout() {
[ -d "$2" ] || git clone --depth 1 "$1" "$2" || failed_checkout "$1"
[ -d "$2" ] || git -c advice.detachedHead=0 clone --branch "$3" --depth 1 "$1" "$2" || failed_checkout "$1"
}

if ! command -v git 1>/dev/null 2>&1; then
Expand All @@ -43,12 +43,12 @@ else
GITHUB="https://github.com"
fi

checkout "${GITHUB}/pyenv/pyenv.git" "${PYENV_ROOT}"
checkout "${GITHUB}/pyenv/pyenv-doctor.git" "${PYENV_ROOT}/plugins/pyenv-doctor"
checkout "${GITHUB}/pyenv/pyenv-installer.git" "${PYENV_ROOT}/plugins/pyenv-installer"
checkout "${GITHUB}/pyenv/pyenv-update.git" "${PYENV_ROOT}/plugins/pyenv-update"
checkout "${GITHUB}/pyenv/pyenv-virtualenv.git" "${PYENV_ROOT}/plugins/pyenv-virtualenv"
checkout "${GITHUB}/pyenv/pyenv-which-ext.git" "${PYENV_ROOT}/plugins/pyenv-which-ext"
checkout "${GITHUB}/pyenv/pyenv.git" "${PYENV_ROOT}" "${PYENV_GIT_TAG:-master}"
checkout "${GITHUB}/pyenv/pyenv-doctor.git" "${PYENV_ROOT}/plugins/pyenv-doctor" "master"
checkout "${GITHUB}/pyenv/pyenv-installer.git" "${PYENV_ROOT}/plugins/pyenv-installer" "master"
checkout "${GITHUB}/pyenv/pyenv-update.git" "${PYENV_ROOT}/plugins/pyenv-update" "master"
checkout "${GITHUB}/pyenv/pyenv-virtualenv.git" "${PYENV_ROOT}/plugins/pyenv-virtualenv" "master"
checkout "${GITHUB}/pyenv/pyenv-which-ext.git" "${PYENV_ROOT}/plugins/pyenv-which-ext" "master"

if ! command -v pyenv 1>/dev/null; then
{ echo
Expand Down

0 comments on commit 49fba59

Please sign in to comment.