Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Create update_manifest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DCSBL authored Aug 12, 2021
1 parent 3c699b7 commit f49611d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/helpers/update_manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Update the manifest file."""
"""Idea from https://github.com/hacs/integration/blob/main/manage/update_manifest.py"""

import sys
import json
import os


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/homewizard_energy/manifest.json") as manifestfile:
manifest = json.load(manifestfile)

manifest["version"] = version

with open(
f"{os.getcwd()}/custom_components/homewizard_energy/manifest.json", "w"
) as manifestfile:
manifestfile.write(json.dumps(manifest, indent=4, sort_keys=True))


update_manifest()

0 comments on commit f49611d

Please sign in to comment.