mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-27 06:03:35 +00:00
19 lines
373 B
Bash
Executable file
19 lines
373 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
|
|
|
VERSION_FILE="$1"
|
|
|
|
if [ -e "$VERSION_FILE" ]; then
|
|
# Read and print the first non-whitespace word from the specified
|
|
# version file.
|
|
while read -a words; do
|
|
version="${words[0]}"
|
|
if [ -n "$version" ]; then
|
|
echo "$version"
|
|
exit
|
|
fi
|
|
done < <( cat "$VERSION_FILE" && echo )
|
|
fi
|
|
|
|
exit 1
|