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.

24 lines
508 B

преди 11 години
преди 10 години
преди 11 години
преди 11 години
  1. #!/usr/bin/env bash
  2. # Usage: pyenv version-file-read <file>
  3. set -e
  4. [ -n "$PYENV_DEBUG" ] && set -x
  5. VERSION_FILE="$1"
  6. if [ -e "$VERSION_FILE" ]; then
  7. # Read the first non-whitespace word from the specified version file.
  8. # Be careful not to load it whole in case there's something crazy in it.
  9. words=( $(cut -b 1-1024 "$VERSION_FILE") )
  10. versions=("${words[@]}")
  11. if [ -n "$versions" ]; then
  12. OLDIFS="$IFS"
  13. { IFS=:
  14. echo "${versions[*]}"
  15. }
  16. IFS="$OLDIFS"
  17. exit
  18. fi
  19. fi
  20. exit 1