Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
begla committed Jun 18, 2024
2 parents 6eee7b8 + dcb36ff commit c9e70c2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions iolite_plugins/update_build_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def hash_djb2(b):
]
platforms = [("windows", "dll"), ("linux", "so")]


for plat in platforms:
any_plugin_found = False

for p in plugins:
dll_filepath = "{}/{}.{}".format(plat[0], p["filename"], plat[1])
json_filepath = "{}/plugins.json".format(plat[0])
Expand All @@ -31,6 +32,13 @@ def hash_djb2(b):
checksum = hash_djb2(plugin_data)
checksum_with_salt = hash_djb2(bytes("{}{}".format(checksum, sys.argv[1]), "ascii"))
p["checksum"] = checksum_with_salt

with open(json_filepath, "w") as plugins_json:
json.dump(plugins, plugins_json, indent=2)
any_plugin_found = True
else:
print("Plugin '{}' not found. Skipping checksum generation...".format(dll_filepath))

# Only write the file if we've found at least one of the plugins
if any_plugin_found:
with open(json_filepath, "w") as plugins_json:
json.dump(plugins, plugins_json, indent=2)
else:
print("No plugins found for platform '{}'. Not writing 'plugins.json' file...".format(plat[0]))

0 comments on commit c9e70c2

Please sign in to comment.