19 lines
348 B
Bash
Executable File
19 lines
348 B
Bash
Executable File
#!/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 < <( cat "$VERSION_FILE" && echo )
|
|
else
|
|
exit 1
|
|
fi
|