Use awk regular expression delimeters and a more precise regexp for the version

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
This commit is contained in:
Richard Wall 2021-05-26 15:07:35 +01:00
parent bb82e007bc
commit 03a794f94c

View File

@ -145,10 +145,10 @@ def helm_chart_yaml(
awk '
BEGIN{
getline v < "$(location %s)"
pr = match(v, "^v[0-9]+.[0-9]+.[0-9]+$$") == 0 ? "true" : "false"
pr = match(v, /^v[0-9]+\.[0-9]+\.[0-9]+$$/) == 0 ? "true" : "false"
}
/{PRERELEASE}/{
gsub("{PRERELEASE}", pr)
gsub(/{PRERELEASE}/, pr)
}1
' $(location %s) > $@
""" % (version_file, chart_yaml_template),