Add optional locked plugin download URLs
This commit is contained in:
@@ -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"),
|
||||
)
|
||||
|
||||
@@ -66,6 +66,7 @@ def _updated_locked_plugin(
|
||||
tag=plugin.get("latestTag"),
|
||||
asset=plugin.get("latestAsset"),
|
||||
sha256=actual_sha256,
|
||||
download_url=plugin.get("latestAssetUrl"),
|
||||
reason=_reason_for_update(
|
||||
plugin,
|
||||
actual_sha256=actual_sha256,
|
||||
|
||||
Reference in New Issue
Block a user