Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@ cython_debug/
#.idea/
*.pyc
.vscode/settings.json

# ignore local devcontainer settings
.devcontainer/*
16 changes: 10 additions & 6 deletions src/fairscape_cli/utils/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,17 @@ def process_merkle_tree(crate_path: Path) -> bool:
metadata_file = crate_path / "ro-crate-metadata.json"
output_path = crate_path / "ro-crate-merkle-tree.json"

try:
tree = generate_merkle_tree(crate_path)
if tree is None:
return False

with open(output_path, 'w') as f:
json.dump(tree, f, indent=2)
try:
if output_path.exists():
pass
else:
tree = generate_merkle_tree(crate_path)
if tree is None:
return False
else:
with open(output_path, 'w') as f:
json.dump(tree, f, indent=2)

# Annotate root entity with the Merkle root hash
with open(metadata_file, 'r') as f:
Expand Down
Loading