Skip to content

Commit

Permalink
Fix regex so that mac can run the scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
norseto committed Mar 31, 2024
1 parent cefa90f commit e437a7d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hack/get-version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
VERSION=$(grep 'RELEASE_VERSION\s*=' version.go | awk -F= '{print $2}' | sed -e 's_"__g' -e 's/\s//g')
VERSION=$(grep 'RELEASE_VERSION\s*=' version.go | awk -F= '{print $2}' | sed -e 's_"__g' -e 's/[[:space:]]//g')
echo ${VERSION}
2 changes: 1 addition & 1 deletion hack/set-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PAT_ALPHA_OR_BETA='^[0-9]+[.][0-9]+[.]0-(alpha|beta)[.][1-9][0-9]*$'
PAT_RELEASE='^([0-9]+[.][0-9]+)[.][0-9]+$'
PAT_BETA_OR_RELEASE='(^[0-9]+[.][0-9]+[.]0+)(-beta[.][1-9][0-9]*)?$'

CURRENT_VERSION=$(grep 'RELEASE_VERSION\s*=' version.go | awk -F= '{print $2}' | sed -e 's_"__g' -e 's/\s//g')
CURRENT_VERSION=$(grep 'RELEASE_VERSION\s*=' version.go | awk -F= '{print $2}' | sed -e 's_"__g' -e 's/[[:space:]]//g')

if [[ ! "${CURRENT_VERSION}" =~ ${PAT_VERSION} ]]; then
echo "Current version ${CURRENT_VERSION} is invalid. It must be 'X.Y.Z', 'X.Y.0-alpha.N' or 'X.Y.0-beta.N'"
Expand Down
2 changes: 1 addition & 1 deletion hack/tag-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -xe

VERSION=$(grep 'RELEASE_VERSION\s*=' version.go | awk -F= '{print $2}' | sed -e 's_"__g' -e 's/\s//g')
VERSION=$(grep 'RELEASE_VERSION\s*=' version.go | awk -F= '{print $2}' | sed -e 's_"__g' -e 's/[[:space:]]//g')

if [[ ! "${VERSION}" =~ ^([0-9]+[.][0-9]+)[.]([0-9]+)(-(alpha|beta)[.]([0-9]+))?$ ]]; then
echo "Version ${VERSION} must be 'X.Y.Z', 'X.Y.Z-alpha.N', or 'X.Y.Z-beta.N'"
Expand Down

0 comments on commit e437a7d

Please sign in to comment.