Skip to content

Commit 0157faf

Browse files
authored
Fix version str, strip the leading v (#654)
Forgot to strip the leading v when update the version string.
1 parent 40aa2d1 commit 0157faf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

continuous-delivery/test-version-exists

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/usr/bin/env bash
22
set -ex
33
#force a failure if there's no tag
4-
git describe --tags
5-
# now get the tag
6-
CURRENT_TAG=$(git describe --tags | cut -f2 -dv)
4+
GIT_TAG=$(git describe --tags)
5+
# Check if the git tag version starts with 'v'
6+
if [[ "$GIT_TAG" != v* ]]; then
7+
echo "Current tag version does not start with 'v', please ensure the tag is correctly formatted."
8+
exit 1
9+
fi
10+
# now get the tag without leading 'v'
11+
CURRENT_TAG=$(echo $GIT_TAG | cut -f2 -dv)
712
# convert v0.2.12-2-g50254a9 to 0.2.12
813
CURRENT_TAG_VERSION=$(git describe --tags | cut -f1 -d'-' | cut -f2 -dv)
914
# if there's a hash on the tag, then this is not a release tagged commit

continuous-delivery/update-version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
text=True).stdout.strip()
1010
# convert v0.2.12-2-g50254a9 to 0.2.12
1111
# test-version-exists will ensure to not include non-tagged commits
12-
version = tag.split('-', 1)[0]
12+
version = tag.strip("v").split('-', 1)[0]
13+
1314
init_path = os.path.join(os.path.dirname(__file__), '..', 'awscrt', '__init__.py')
1415
print("Updating awscrt.__version__ to version {}".format(version))
1516
contents = None

0 commit comments

Comments
 (0)