github::latest -> latest_tag
This commit is contained in:
parent
94b6d26ddd
commit
0ec2a44082
@ -1,6 +1,6 @@
|
|||||||
use semver::Version;
|
use semver::Version;
|
||||||
|
|
||||||
pub fn latest(owner: &str, repo: &str) -> String {
|
pub fn latest_tag(owner: &str, repo: &str) -> String {
|
||||||
let github_body = crate::http::get_body_string(
|
let github_body = crate::http::get_body_string(
|
||||||
format!(
|
format!(
|
||||||
"https://api.github.com/repos/{}/{}/releases/latest",
|
"https://api.github.com/repos/{}/{}/releases/latest",
|
||||||
@ -15,7 +15,7 @@ pub fn latest(owner: &str, repo: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn latest_version(owner: &str, repo: &str) -> Version {
|
pub fn latest_version(owner: &str, repo: &str) -> Version {
|
||||||
Version::parse(&latest(owner, repo)).unwrap()
|
Version::parse(&latest_tag(owner, repo)).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn latest_release_url(owner: &str, repo: &str) -> String {
|
pub fn latest_release_url(owner: &str, repo: &str) -> String {
|
||||||
|
@ -14,7 +14,7 @@ pub fn local_revision(dir: &Path) -> u16 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn remote_revision() -> u16 {
|
pub fn remote_revision() -> u16 {
|
||||||
misc::rev_to_int(&github::latest(GH_IW4X_OWNER, GH_IW4X_REPO))
|
misc::rev_to_int(&github::latest_tag(GH_IW4X_OWNER, GH_IW4X_REPO))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_available(dir: &Path) -> bool {
|
pub fn update_available(dir: &Path) -> bool {
|
||||||
@ -36,7 +36,7 @@ pub fn update(dir: &Path) {
|
|||||||
);
|
);
|
||||||
fs::write(
|
fs::write(
|
||||||
dir.join(".iw4xrevision"),
|
dir.join(".iw4xrevision"),
|
||||||
github::latest(GH_IW4X_OWNER, GH_IW4X_REPO),
|
github::latest_tag(GH_IW4X_OWNER, GH_IW4X_REPO),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user