From a07831b644a8e5e02c11c37ef58bfabb9bcc04f5 Mon Sep 17 00:00:00 2001 From: gpBlockchain <744158715@qq.com> Date: Tue, 27 Jun 2023 16:28:35 +0800 Subject: [PATCH] fix: get root dir failed --- framework/util.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/util.py b/framework/util.py index c1b2ad4..8437e73 100644 --- a/framework/util.py +++ b/framework/util.py @@ -96,4 +96,10 @@ def run_command(cmd): def get_project_root(): current_path = os.path.dirname(os.path.abspath(__file__)) - return "{path}/ckb-py-integration-test".format(path=current_path.split("/ckb-py-integration-test")[0]) + pattern = r"(.*ckb-py-integration-test)" + matches = re.findall(pattern, current_path) + if matches: + root_dir = max(matches, key=len) + return root_dir + else: + raise Exception("not found ckb-py-integration-test dir") \ No newline at end of file