mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add json fields for manifest version and asset list
Make it so it could actually be checked and parsed properly.
This commit is contained in:
parent
da3142812b
commit
631535a4c9
@ -1,5 +1,6 @@
|
||||
#------------------------------------------------------------------------------
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import hashlib
|
||||
|
||||
@ -38,14 +39,28 @@ def RecursiveComputeChecksum(directoryPath):
|
||||
#------------------------------------------------------------------------------
|
||||
# Save the checksums to a manifest file
|
||||
#------------------------------------------------------------------------------
|
||||
def CreateManifest(checksums, outManifestFile):
|
||||
def CreateManifest(version, checksums, outManifestFile):
|
||||
manifest = {
|
||||
"version": version,
|
||||
"assets": checksums
|
||||
}
|
||||
with open(outManifestFile, "w") as jsonFile:
|
||||
json.dump(checksums, jsonFile, indent=4)
|
||||
json.dump(manifest, jsonFile, indent=4)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: bld_man.py <versionNum>")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
version = int(sys.argv[1])
|
||||
except ValueError:
|
||||
print("Version must be an integer")
|
||||
sys.exit(1)
|
||||
|
||||
workingDirectory = os.getcwd()
|
||||
outManifestFile = "manifest.json"
|
||||
outManifestFile = "patch_manifest.json"
|
||||
|
||||
checksums = RecursiveComputeChecksum(workingDirectory)
|
||||
CreateManifest(checksums, outManifestFile)
|
||||
CreateManifest(version, checksums, outManifestFile)
|
||||
|
Loading…
x
Reference in New Issue
Block a user