mirror of
https://github.com/pyenv/pyenv.git
synced 2026-02-06 02:37:36 +09:00
19 lines
331 B
Plaintext
19 lines
331 B
Plaintext
|
|
#!/usr/bin/env bash
|
||
|
|
set -e
|
||
|
|
|
||
|
|
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"
|
||
|
|
break
|
||
|
|
fi
|
||
|
|
done < "$VERSION_FILE"
|
||
|
|
else
|
||
|
|
exit 1
|
||
|
|
fi
|