Fix a bug in parse_version that prevented using auxillary version files

This commit is contained in:
Matt Keeler 2018-06-18 10:07:29 -04:00
parent e7b0a729ea
commit c94c212e97
1 changed files with 2 additions and 2 deletions

View File

@ -141,9 +141,9 @@ function parse_version {
# try to determine the version if we have build tags # try to determine the version if we have build tags
for tag in "$GOTAGS" for tag in "$GOTAGS"
do do
for vfile in $(ls "${1}/version/version_*.go" 2> /dev/null| sort) for vfile in $(find "${1}/version" -name "version_*.go" 2> /dev/null| sort)
do do
if grep -q "// +build $tag" $file if grep -q "// +build $tag" "${vfile}"
then then
version_main=$(awk '$1 == "Version" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile}) version_main=$(awk '$1 == "Version" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile})
release_main=$(awk '$1 == "VersionPrerelease" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile}) release_main=$(awk '$1 == "VersionPrerelease" && $2 == "=" { gsub(/"/, "", $3); print $3 }' < ${vfile})