move semver regex to a dedicated variable

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-02-13 08:49:58 +01:00
parent bafb030387
commit 1ef091688a

View File

@@ -22,7 +22,9 @@
ERROR=0
QUERY_INTRO=$(git grep "env:" -- '*.go' |grep -v -P "introductionVersion:\"([0-9.]{3,}([-].*)?|(pre5\.0))\""|grep -v "_test.go"|grep -v "vendor/")
SEMVER_REGEX="([0-9]|[1-9][0-9]*)(\.([0-9]|[1-9][0-9]*)){1,2}(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?"
QUERY_INTRO=$(git grep "env:" -- '*.go' |grep -v -P "introductionVersion:\"($SEMVER_REGEX|(pre5\.0))\""|grep -v "_test.go"|grep -v "vendor/")
RESULTS_INTRO=$(echo "${QUERY_INTRO}"|wc -l)
if [ "${RESULTS_INTRO}" -gt 0 ]; then