From 7785bccfb7e57d8b20dff3b2f87247ffeb0a5713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Sat, 25 Feb 2023 20:37:05 +0800 Subject: [PATCH] Refactor: load version from workspace Cargo.toml if it is defined there --- scripts/build_change_log.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/build_change_log.py b/scripts/build_change_log.py index 80bda742b..b95d8f9c4 100755 --- a/scripts/build_change_log.py +++ b/scripts/build_change_log.py @@ -284,6 +284,13 @@ def load_cargo_version(): t = toml.loads(cargo) ver = t['package']['version'] + + if ver == {'workspace': True}: + with open('./Cargo.toml', 'r') as f: + cargo = f.read() + t = toml.loads(cargo) + ver = t['workspace']['package']['version'] + print("--- openraft/Cargo.toml version is", ver) return ver