mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-22 17:53:41 +00:00
hook script to add latest suffix for install command
This commit is contained in:
parent
b4a5bb3d85
commit
4c4457b22f
1 changed files with 7 additions and 0 deletions
7
pyenv.d/install/latest.bash
Normal file
7
pyenv.d/install/latest.bash
Normal file
|
@ -0,0 +1,7 @@
|
|||
DEFINITION_PREFIX="${DEFINITION%%:*}"
|
||||
DEFINITION_TYPE="${DEFINITION_PREFIX%%-*}" # TODO: support non-CPython versions
|
||||
if [[ "${DEFINITION}" != "${DEFINITION_PREFIX}" ]]; then
|
||||
DEFINITION_CANDIDATES=($(python-build --definitions | grep -F "${DEFINITION_PREFIX}" | grep "^${DEFINITION_TYPE}" | sed -e '/-dev$/d' -e '/-src$/d' | sort -t. -k1,1r -k 2,2nr -k 3,3nr || true))
|
||||
DEFINITION="${DEFINITION_CANDIDATES}"
|
||||
VERSION_NAME="${DEFINITION##*/}"
|
||||
fi
|
Loading…
Reference in a new issue