2011-08-18 21:11:40 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2011-09-12 17:11:59 +02:00
|
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
2011-08-18 21:11:40 +02:00
|
|
|
|
|
|
|
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"
|
2011-09-11 17:16:08 +02:00
|
|
|
exit
|
2011-08-18 21:11:40 +02:00
|
|
|
fi
|
2011-09-07 21:46:29 +02:00
|
|
|
done < <( cat "$VERSION_FILE" && echo )
|
2011-08-18 21:11:40 +02:00
|
|
|
fi
|
2011-09-09 22:52:31 +02:00
|
|
|
|
|
|
|
exit 1
|