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.

28 lines
875B

  1. import sys
  2. import json
  3. for filename in sys.argv[1:]:
  4. with open(filename, "r") as f:
  5. manifest1 = json.load(f)
  6. manifest2 = {}
  7. if 'name' in manifest1:
  8. manifest2['name'] = manifest1['name']
  9. if 'author' in manifest1:
  10. manifest2['author'] = manifest1['author']
  11. if 'license' in manifest1:
  12. manifest2['license'] = manifest1['license']
  13. if 'homepage' in manifest1:
  14. manifest2['websiteUrl'] = manifest1['homepage']
  15. if 'manual' in manifest1:
  16. manifest2['manualUrl'] = manifest1['manual']
  17. if 'source' in manifest1:
  18. manifest2['sourceUrl'] = manifest1['source']
  19. if 'donation' in manifest1:
  20. manifest2['donateUrl'] = manifest1['donation']
  21. if 'version' in manifest1:
  22. manifest2['latestVersion'] = manifest1['version']
  23. if 'productId' in manifest1:
  24. manifest2['productId'] = manifest1['productId']
  25. with open(filename, "w") as f:
  26. json.dump(manifest2, f, indent=" ")