Skip to content

Commit

Permalink
fix: get root dir failed
Browse files Browse the repository at this point in the history
  • Loading branch information
gpBlockchain committed Jun 27, 2023
1 parent cf2e2cb commit a07831b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit a07831b

Please sign in to comment.