Skip to content

Commit 5d6f2e6

Browse files
committed
BUG/MINOR: when generating server handle tags that have more that 4 words
tags like `v.2.5.0-dev10` now are properly handled
1 parent 85e3a2d commit 5d6f2e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

generate/swagger/script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ "$REMOTE_VERSION" = "null" ]; then
1313
CN_VERSION=$(go mod edit -json | jq -c -r '.Replace | .[] | select(.Old.Path | contains("github.com/haproxytech/client-native/v2")) | .New.Path' 2>/dev/null) || ""
1414
fi
1515
# if hash is to short take all of it (example v1.0.0-dev1)
16-
[ "${#CN_VERSION}" -gt 0 ] && [ "${#CN_VERSION}" -lt 4 ] && CN_VERSION=$(go mod edit -json | jq -c -r '.Replace | .[] | select(.Old.Path | contains("github.com/haproxytech/client-native/v2")) | .New.Version')
16+
[ "${#CN_VERSION}" -gt 0 ] && [ "${#CN_VERSION}" -lt 6 ] && CN_VERSION=$(go mod edit -json | jq -c -r '.Replace | .[] | select(.Old.Path | contains("github.com/haproxytech/client-native/v2")) | .New.Version')
1717
# check if version is there, if not, use one from require
1818
[ -z "$CN_VERSION" ] && CN_VERSION=$(go mod edit -json | jq -c -r '.Require | .[] | select(.Path | contains("github.com/haproxytech/client-native/v2")) | .Version' 2>/dev/null | awk -F"-" '{print $NF}')
1919
echo " ---> version of client native used: $CN_VERSION"

0 commit comments

Comments
 (0)