From 36e4b6fd459f7941f287d247fb101eaff212cc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 18 May 2022 20:47:40 +0200 Subject: [PATCH] [core] Write manifests when installing packages --- platform.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform.py b/platform.py index 7e07584..6fcccca 100644 --- a/platform.py +++ b/platform.py @@ -38,6 +38,9 @@ def load_manifest(self, src): manifest: dict = libretuya_packages[spec.name] # find additional manifest info manifest = manifest.get("manifest", manifest_default) + # extract tag version + if "#" in spec.url: + manifest["version"] = spec.url.rpartition("#")[2].lstrip("v") # put info from spec manifest.update( { @@ -52,6 +55,8 @@ def load_manifest(self, src): cache_key = "load_manifest-%s" % path self.memcache_set(cache_key, manifest) # result = ManifestParserFactory.new(json.dumps(manifest), ManifestFileType.PACKAGE_JSON).as_dict() + with open(join(path, self.manifest_names[0]), "w") as f: + json.dump(manifest, f) return manifest