You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
487B

  1. import sys
  2. import json
  3. import os
  4. import glob
  5. for filename in glob.glob("repos/*/plugin.json"):
  6. # Read plugin manifest
  7. try:
  8. with open(filename, "r") as f:
  9. manifest = json.load(f, strict=False)
  10. except Exception as e:
  11. print(f"Could not parse {filename}")
  12. print(e)
  13. continue
  14. # Write library manifest
  15. slug = manifest["slug"]
  16. manifest_filename = f"manifests/{slug}.json"
  17. with open(manifest_filename, "w") as f:
  18. json.dump(manifest, f, indent=" ")
  19. print(f"Copied {slug}")