Skip to content

Commit

Permalink
Fix manifest generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
vigonotion committed Apr 12, 2021
1 parent 5d57d68 commit 3242037
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions manage/update_manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Update the manifest file."""
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/stadtreinigung_hamburg/manifest.json"
) as manifestfile:
manifest = json.load(manifestfile)

manifest["version"] = version

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


update_manifest()

0 comments on commit 3242037

Please sign in to comment.