From 18a7714effa8728c27482f48b49a41f6e8be0338 Mon Sep 17 00:00:00 2001 From: r0-negative <50054605+r0-negative@users.noreply.github.com> Date: Mon, 22 Jul 2024 01:36:12 +0200 Subject: [PATCH 1/2] Fix Circular Reference Issue and Ensure Correct Path for Chromium Build --- src/nopecha/extension/extension.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/nopecha/extension/extension.py b/src/nopecha/extension/extension.py index 6fcb8da..9fd546c 100644 --- a/src/nopecha/extension/extension.py +++ b/src/nopecha/extension/extension.py @@ -53,10 +53,10 @@ def build( raise RuntimeError(f"Could not find download link for {branch}") if outpath.exists(): - manifest = loads((outpath / "manifest.json").read_text()) - if manifest["version_name"] != latest_release["tag_name"]: + manifest_file = loads((outpath / "manifest.json").read_text()) + if manifest_file["version_name"] != latest_release["tag_name"]: print( - f"[NopeCHA] {latest_release['tag_name']} is available, you got {manifest['version_name']}" + f"[NopeCHA] {latest_release['tag_name']} is available, you got {manifest_file['version_name']}" ) download_release(download_url, outpath) @@ -64,13 +64,14 @@ def build( print(f"[NopeCHA] Downloading {latest_release['tag_name']}") download_release(download_url, outpath) - manifest = loads((outpath / "manifest.json").read_text()) - manifest["nopecha"].update(manifest) - (outpath / "manifest.json").write_text(dumps(manifest, indent=2)) + manifest_file = loads((outpath / "manifest.json").read_text()) + manifest_file["nopecha"].update(manifest) + print(manifest_file["nopecha"]) + (outpath / "manifest.json").write_text(dumps(manifest_file, indent=2)) print(f"[NopeCHA] Built {branch} extension to {outpath}") - return str(outpath) + return str(outpath.absolute()) def build_chromium( From 86181af18f6d3f2367017bf8ef692b78c94eb257 Mon Sep 17 00:00:00 2001 From: Michel Angelo <50054605+r0-negative@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:55:07 +0200 Subject: [PATCH 2/2] Update src/nopecha/extension/extension.py Co-authored-by: Leo Developer --- src/nopecha/extension/extension.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nopecha/extension/extension.py b/src/nopecha/extension/extension.py index 9fd546c..4ce6348 100644 --- a/src/nopecha/extension/extension.py +++ b/src/nopecha/extension/extension.py @@ -66,7 +66,6 @@ def build( manifest_file = loads((outpath / "manifest.json").read_text()) manifest_file["nopecha"].update(manifest) - print(manifest_file["nopecha"]) (outpath / "manifest.json").write_text(dumps(manifest_file, indent=2)) print(f"[NopeCHA] Built {branch} extension to {outpath}")