mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
maint: handle missing tag_name from github's JSON reply
This commit is contained in:
@@ -10,8 +10,16 @@ pub async fn latest_tag(owner: &str, repo: &str) -> String {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let github_json: serde_json::Value = serde_json::from_str(&github_body).unwrap();
|
let github_json: serde_json::Value = serde_json::from_str(&github_body).unwrap();
|
||||||
github_json["tag_name"].to_string().replace('"', "")
|
|
||||||
|
if let Some(tag_name) = github_json.get("tag_name") {
|
||||||
|
if let Some(tag_name_str) = tag_name.as_str() {
|
||||||
|
return tag_name_str.to_string().replace('"', "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"0.0.0".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn latest_version(owner: &str, repo: &str) -> Version {
|
pub async fn latest_version(owner: &str, repo: &str) -> Version {
|
||||||
|
|||||||
Reference in New Issue
Block a user