您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

20 行
442 B

  1. #!/usr/bin/env bash
  2. # Usage: rbenv version-file-read <file>
  3. set -e
  4. [ -n "$RBENV_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. version="${words[0]}"
  11. if [ -n "$version" ]; then
  12. echo "$version"
  13. exit
  14. fi
  15. fi
  16. exit 1