Skip to content

Commit f1c1458

Browse files
committed
feat: Check the version in package.json
1 parent 896abfc commit f1c1458

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

script/release.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ def verify_version(version):
5656
if v[0] != v[1]:
5757
raise Error("version.h: define '{}' does not match (got '{}', expected '{}')".format(k, v[0], v[1]))
5858

59+
with open('package.json') as f:
60+
pkg = json.load(f)
61+
62+
try:
63+
pkg_version = Version(pkg["version"])
64+
except KeyError as err:
65+
raise Error("package.json: missing the field {}".format(err))
66+
67+
if pkg_version != version:
68+
raise Error("package.json: version does not match (got '{}', expected '{}')".format(pkg_version, version))
69+
5970
def generate_relnotes(tree, version):
6071
with open('docs/changelog.md') as f:
6172
lines = f.readlines()

0 commit comments

Comments
 (0)