Initial Commit

This commit is contained in:
brotoskyj
2025-12-29 14:16:52 -05:00
commit 2b62bd3683
9 changed files with 5940 additions and 0 deletions
View File
+2
View File
@@ -0,0 +1,2 @@
pub mod updator;
pub mod downloadyt;
+20
View File
@@ -0,0 +1,20 @@
use serde::Deserialize;
use semver::Version;
use reqwest;
#[derive(Deserialize, Debug)]
struct Release {
tag_name: String,
}
pub async fn update() {
let body = reqwest::get("https://git.racooncity.org/api/v1/repos/brotoskyj/RhythmWorks/releases/latest").await.unwrap().text().await.unwrap();
let release_info: Release = serde_json::from_str(&body).unwrap();
let latest_version = Version::parse(&release_info.tag_name).unwrap();
let current_version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
if latest_version > current_version {
println!("Update Available")
}
else {
println!("Already on current version");
}
}