use std::env;
const DEFAULT_ENDPOINT: &str = "https://analytics.offlineprotocol.com/v1/events";
fn main() {
println!("cargo:rerun-if-env-changed=OFFLINE_TELEMETRY_ENDPOINT");
let endpoint = env::var("OFFLINE_TELEMETRY_ENDPOINT")
.ok()
.filter(|value| !value.trim().is_empty())
.unwrap_or_else(|| DEFAULT_ENDPOINT.to_string());
assert!(
endpoint.starts_with("https://"),
"OFFLINE_TELEMETRY_ENDPOINT must start with https:// (got {endpoint:?}); \
the telemetry pipe never sends a bearer token over plaintext"
);
println!("cargo:rustc-env=OFFLINE_TELEMETRY_ENDPOINT={endpoint}");
}