Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

22 linhas
538 B

  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. IFS="${IFS}"$'\r'
  10. words=($(cut -b 1-1024 "$VERSION_FILE" | sed 's/[[:space:]]*\([^[:space:]^[:space:]]*\).*/\1/'))
  11. versions=("${words[@]}")
  12. if [ -n "$versions" ]; then
  13. IFS=":"
  14. echo "${versions[*]}"
  15. exit
  16. fi
  17. fi
  18. exit 1