Add optional locked plugin download URLs

This commit is contained in:
pleb
2026-07-10 09:17:02 -07:00
parent 26def9609d
commit 538feae811
7 changed files with 121 additions and 10 deletions
+4
View File
@@ -42,6 +42,7 @@ class LockedPlugin:
tag: str | None
asset: str | None
sha256: str | None
download_url: str | None = None
install_strategy: str | None = None
reason: str | None = None
@@ -72,6 +73,8 @@ def lockfile_to_toml(lockfile: Lockfile) -> str:
lines.append(f"tag = {_quote_toml_string(plugin.tag)}")
if plugin.asset is not None:
lines.append(f"asset = {_quote_toml_string(plugin.asset)}")
if plugin.download_url is not None:
lines.append(f"download_url = {_quote_toml_string(plugin.download_url)}")
if plugin.sha256 is not None:
lines.append(f"sha256 = {_quote_toml_string(plugin.sha256)}")
if plugin.install_strategy is not None:
@@ -156,6 +159,7 @@ def load_lockfile(path: Path) -> Lockfile:
tag=item.get("tag"),
asset=item.get("asset"),
sha256=item.get("sha256"),
download_url=item.get("download_url"),
install_strategy=item.get("install_strategy"),
reason=item.get("reason"),
)