Files
hacs_integration/manage/update_manifest.py
Joakim Sørensen 1d4b8528a7 Update linting rules (#2179)
* Update linting rules

* isort

* update makefile
2021-08-27 17:15:56 +02:00

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()