mirror of
https://github.com/hacs/integration.git
synced 2025-07-29 12:50:01 +00:00
24 lines
628 B
Python
24 lines
628 B
Python
"""Update the manifest file."""
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
|
|
def update_manifest():
|
|
"""Update the manifest file."""
|
|
version = "0.0.0"
|
|
for index, value in enumerate(sys.argv):
|
|
if value in ["--version", "-V"]:
|
|
version = sys.argv[index + 1]
|
|
|
|
with open(f"{os.getcwd()}/custom_components/hacs/manifest.json") as manifestfile:
|
|
manifest = json.load(manifestfile)
|
|
|
|
manifest["version"] = version
|
|
|
|
with open(f"{os.getcwd()}/custom_components/hacs/manifest.json", "w") as manifestfile:
|
|
manifestfile.write(json.dumps(manifest, indent=4, sort_keys=True))
|
|
|
|
|
|
update_manifest()
|