From 08b7522777b25716226deb395711cfc541cdd0c5 Mon Sep 17 00:00:00 2001 From: eggfly <922837+eggfly@users.noreply.github.com> Date: Wed, 15 Jul 2026 09:32:31 +0000 Subject: [PATCH] fix(czdev): write pool-layout asset paths and author into meta.json publish copies the icon and screenshots into pool/main// flat (icon at , screenshots under screenshots/) but meta.json kept the app-builder.json source-repo paths (e.g. share/images/foo.png, store/screenshots/a.png), so the store registry generator resolved them to 404s and every czdev-submitted app rendered without an icon. Rewrite both fields to the layout the files were actually copied into. meta.json also carried no author, which the store showed as '@undefined'. Emit an author object from the authenticated GitHub login plus the Maintainer display name, letting an explicit store.author in app-builder.json take precedence. (The store's registry generator now also normalizes legacy meta.json on its side, so previously published packages are already fixed; this makes new submissions correct at the source.) --- scripts/czdev/publish.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/czdev/publish.py b/scripts/czdev/publish.py index 2acdda8..50bd187 100644 --- a/scripts/czdev/publish.py +++ b/scripts/czdev/publish.py @@ -165,8 +165,24 @@ def run(deb: Optional[str] = None): if icon_src.exists(): shutil.copy2(icon_src, dest_dir / icon_src.name) - # meta.json + release manifest (the binary stays in the buffer release) - (dest_dir / "meta.json").write_text(json.dumps(store_meta, indent=2, ensure_ascii=False)) + # meta.json + release manifest (the binary stays in the buffer release). + # Asset paths are rewritten to the pool layout the files were just + # copied into (icon at /, screenshots under + # /screenshots/) — the app-builder.json values are + # source-repo relative and would 404 when the store resolves them + # against pool/main//. + meta_out = dict(store_meta) + if meta_out.get("icon"): + meta_out["icon"] = Path(meta_out["icon"]).name + if meta_out.get("screenshots"): + meta_out["screenshots"] = [f"screenshots/{Path(s).name}" for s in meta_out["screenshots"]] + if not isinstance(meta_out.get("author"), dict) or not meta_out.get("author"): + display_name = meta["maintainer"].split("<")[0].strip() + meta_out["author"] = { + "github": user.login, + "display_name": display_name or user.login, + } + (dest_dir / "meta.json").write_text(json.dumps(meta_out, indent=2, ensure_ascii=False)) (dest_dir / manifest_name).write_text(json.dumps(manifest, indent=2) + "\n") print(" → Creating commit... ", end="", flush=True) @@ -267,6 +283,8 @@ def load_store_meta(deb_path: str) -> tuple: meta["icon"] = store["icon"] if store.get("permissions"): meta["permissions"] = store["permissions"] + if isinstance(store.get("author"), dict): + meta["author"] = store["author"] if not meta["screenshots"]: print("No screenshots defined in app-builder.json store.screenshots.", file=sys.stderr)