From 4deadeffd51cd9aff3dfb6de7c1890397da74fcf Mon Sep 17 00:00:00 2001 From: Roland Schaer Date: Thu, 1 Aug 2024 23:19:22 +0200 Subject: [PATCH] fix: spm - cannot install package with null release name field --- src/github.rs | 6 +++--- src/plugins/core/deno.rs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/github.rs b/src/github.rs index 4059b6296..d6e34f6e7 100644 --- a/src/github.rs +++ b/src/github.rs @@ -3,11 +3,11 @@ use serde_derive::Deserialize; #[derive(Debug, Deserialize)] pub struct GithubRelease { pub tag_name: String, - pub name: String, - pub body: String, + pub name: Option, + pub body: Option, pub prerelease: bool, pub created_at: String, - pub published_at: String, + pub published_at: Option, } pub fn list_releases(repo: &str) -> eyre::Result> { diff --git a/src/plugins/core/deno.rs b/src/plugins/core/deno.rs index 560b3bcf9..487942b31 100644 --- a/src/plugins/core/deno.rs +++ b/src/plugins/core/deno.rs @@ -40,8 +40,7 @@ impl DenoPlugin { HTTP_FETCH.json("https://api.github.com/repos/denoland/deno/releases?per_page=100")?; let versions = releases .into_iter() - .map(|r| r.name) - .filter(|v| !v.is_empty()) + .map(|r| r.tag_name) .filter(|v| v.starts_with('v')) .map(|v| v.trim_start_matches('v').to_string()) .unique()