You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
503 B

  1. #!/usr/bin/env bash
  2. # Summary: Show the current Python version and its origin
  3. #
  4. # Shows the currently selected Python version and how it was
  5. # selected. To obtain only the version string, use `pyenv
  6. # version-name'.
  7. set -e
  8. [ -n "$PYENV_DEBUG" ] && set -x
  9. exitcode=0
  10. OLDIFS="$IFS"
  11. IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name)) || exitcode=$?
  12. IFS="$OLDIFS"
  13. for PYENV_VERSION_NAME in "${PYENV_VERSION_NAMES[@]}"; do
  14. echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
  15. done
  16. exit $exitcode