mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Always allow overriding amplitude API key via a runtime env var
This commit is contained in:
parent
824fdb54e6
commit
f2db3abdb2
@ -39,9 +39,9 @@ struct TelemetryState {
|
|||||||
const AMPLITUDE_EVENTS_URL: &'static str = "https://api2.amplitude.com/batch";
|
const AMPLITUDE_EVENTS_URL: &'static str = "https://api2.amplitude.com/batch";
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref AMPLITUDE_API_KEY: Option<String> = option_env!("AMPLITUDE_API_KEY")
|
static ref AMPLITUDE_API_KEY: Option<String> = std::env::var("ZED_AMPLITUDE_API_KEY")
|
||||||
.map(|key| key.to_string())
|
.ok()
|
||||||
.or(std::env::var("AMPLITUDE_API_KEY").ok());
|
.or_else(|| option_env!("ZED_AMPLITUDE_API_KEY").map(|key| key.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
|
Loading…
Reference in New Issue
Block a user