File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 15
15
# if hash is to short take all of it (example v1.0.0-dev1)
16
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/v3")) | .New.Version' )
17
17
# check if version is there, if not, use one from require
18
- [ -z " $CN_VERSION " ] && CN_VERSION=$( go mod edit -json | jq -c -r ' .Require | .[] | select(.Path | contains("github.com/haproxytech/client-native/v3")) | .Version' 2> /dev/null | awk -F" -" ' {print $NF}' )
18
+ [ -z " $CN_VERSION " ] && CN_VERSION=$( go mod edit -json | jq -c -r ' .Require | .[] | select(.Path | contains("github.com/haproxytech/client-native/v3")) | .Version' 2> /dev/null)
19
+ # check if version contains '-' and if it is a 12 char commit hash then use it, if not use the whole tag
20
+ suffix=$( echo $CN_VERSION | awk -F" -" ' {print$NF}' )
21
+ [ -z " ${CN_VERSION##* " -" * } " ] && [ ${# suffix} -eq 12 ] && CN_VERSION=$suffix
19
22
echo " ---> version of client native used: $CN_VERSION "
20
23
# extract repository
21
24
REPO_PATH=$( go mod edit -json | jq -r ' .Replace | .[] | select(.Old.Path | contains("github.com/haproxytech/client-native/v3")) | .New.Path' 2> /dev/null | awk -F" /" ' {print $2 "/" $3}' ) || " "
You can’t perform that action at this time.
0 commit comments