Skip to content

Commit 7785bcc

Browse files
committed
Refactor: load version from workspace Cargo.toml if it is defined there
1 parent 03c32b0 commit 7785bcc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/build_change_log.py

+7
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ def load_cargo_version():
284284

285285
t = toml.loads(cargo)
286286
ver = t['package']['version']
287+
288+
if ver == {'workspace': True}:
289+
with open('./Cargo.toml', 'r') as f:
290+
cargo = f.read()
291+
t = toml.loads(cargo)
292+
ver = t['workspace']['package']['version']
293+
287294
print("--- openraft/Cargo.toml version is", ver)
288295
return ver
289296

0 commit comments

Comments
 (0)