mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-06-28 21:06:26 +02:00
cli: use update.yaak.app /cli/check for version checks
This commit is contained in:
@@ -110,7 +110,7 @@ fn should_skip_check() -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn fetch_version_check() -> Option<VersionCheckResponse> {
|
async fn fetch_version_check() -> Option<VersionCheckResponse> {
|
||||||
let api_url = format!("{}/api/v1/cli/version-check", api_base_url());
|
let api_url = format!("{}/cli/check", update_base_url());
|
||||||
let current_version = version::cli_version();
|
let current_version = version::cli_version();
|
||||||
let payload = VersionCheckRequest {
|
let payload = VersionCheckRequest {
|
||||||
current_version,
|
current_version,
|
||||||
@@ -146,11 +146,10 @@ fn install_source() -> String {
|
|||||||
.unwrap_or_else(|| "source".to_string())
|
.unwrap_or_else(|| "source".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn api_base_url() -> &'static str {
|
fn update_base_url() -> &'static str {
|
||||||
match std::env::var("ENVIRONMENT").ok().as_deref() {
|
match std::env::var("ENVIRONMENT").ok().as_deref() {
|
||||||
Some("staging") => "https://todo.yaak.app",
|
|
||||||
Some("development") => "http://localhost:9444",
|
Some("development") => "http://localhost:9444",
|
||||||
_ => "https://api.yaak.app",
|
_ => "https://update.yaak.app",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user