Skip to content

Commit 399186a

Browse files
authored
fixing the version and make the release.sh script catch wrong format (#211)
1 parent 91adae4 commit 399186a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

internal/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package version
33

44
// DDLambdaVersion is the current version number of this library (datadog-lambda-go).
55
// It is automatically updated by the release script.
6-
const DDLambdaVersion = "v1.27.0"
6+
const DDLambdaVersion = "1.27.0"
77

88
// DDTraceVersion is the version of dd-trace-go required by this libary.
99
// This should match the version number specified in go.mod.

scripts/release.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ fi
2525
if [ -z "$1" ]; then
2626
echo "Must specify a desired version number"
2727
exit 1
28-
elif [[ ! $1 =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
29-
echo "Must use a semantic version, e.g., 3.1.4"
30-
exit 1
3128
else
32-
NEW_VERSION=$1
29+
# Remove 'v' prefix if present
30+
CLEAN_VERSION=${1#v}
31+
32+
if [[ ! $CLEAN_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
33+
echo "Must use a semantic version, e.g., 3.1.4"
34+
exit 1
35+
else
36+
NEW_VERSION=$CLEAN_VERSION
37+
fi
3338
fi
3439

3540
CURRENT_DD_TRACE_VERSION="$(grep "const DDTraceVersion" internal/version/version.go | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+")"

0 commit comments

Comments
 (0)