Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

54 Zeilen
971 B

  1. #!/usr/bin/env bash
  2. # Summary: List hook scripts for a given pyenv command
  3. # Usage: pyenv hooks <command>
  4. set -e
  5. [ -n "$PYENV_DEBUG" ] && set -x
  6. # Provide pyenv completions
  7. if [ "$1" = "--complete" ]; then
  8. echo exec
  9. echo rehash
  10. echo which
  11. exit
  12. fi
  13. PYENV_COMMAND="$1"
  14. if [ -z "$PYENV_COMMAND" ]; then
  15. pyenv-help --usage hooks >&2
  16. exit 1
  17. fi
  18. READLINK=$(type -p greadlink readlink | head -1)
  19. if [ -z "$READLINK" ]; then
  20. echo "pyenv: cannot find readlink - are you missing GNU coreutils?" >&2
  21. exit 1
  22. fi
  23. resolve_link() {
  24. $READLINK "$1"
  25. }
  26. realpath() {
  27. local cwd="$(pwd)"
  28. local path="$1"
  29. while [ -n "$path" ]; do
  30. cd "${path%/*}"
  31. local name="${path##*/}"
  32. path="$(resolve_link "$name" || true)"
  33. done
  34. echo "$(pwd)/$name"
  35. cd "$cwd"
  36. }
  37. IFS=: hook_paths=($PYENV_HOOK_PATH)
  38. shopt -s nullglob
  39. for path in "${hook_paths[@]}"; do
  40. for script in "$path/$PYENV_COMMAND"/*.bash; do
  41. echo $(realpath $script)
  42. done
  43. done
  44. shopt -u nullglob