mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
Allow overriding release channel at runtime via env var
This commit is contained in:
parent
92a4998ddc
commit
f1b41389b3
2 changed files with 5 additions and 4 deletions
|
@ -991,13 +991,13 @@ impl Client {
|
|||
.zip(rpc_url.port_or_known_default())
|
||||
.ok_or_else(|| anyhow!("missing host in rpc url"))?;
|
||||
let stream = smol::net::TcpStream::connect(rpc_host).await?;
|
||||
rpc_url.set_query(if is_preview { Some("preview=1") } else { None });
|
||||
|
||||
log::info!("connected to rpc endpoint {}", rpc_url);
|
||||
|
||||
match rpc_url.scheme() {
|
||||
"https" => {
|
||||
rpc_url.set_scheme("wss").unwrap();
|
||||
rpc_url.set_query(if is_preview { Some("preview=1") } else { None });
|
||||
let request = request.uri(rpc_url.as_str()).body(())?;
|
||||
let (stream, _) =
|
||||
async_tungstenite::async_tls::client_async_tls(request, stream).await?;
|
||||
|
|
|
@ -69,14 +69,15 @@ actions!(
|
|||
);
|
||||
|
||||
const MIN_FONT_SIZE: f32 = 6.0;
|
||||
const RELEASE_CHANNEL_NAME: &str = include_str!("../RELEASE_CHANNEL");
|
||||
|
||||
lazy_static! {
|
||||
pub static ref RELEASE_CHANNEL: ReleaseChannel = match RELEASE_CHANNEL_NAME {
|
||||
static ref RELEASE_CHANNEL_NAME: String =
|
||||
env::var("ZED_RELEASE_CHANNEL").unwrap_or(include_str!("../RELEASE_CHANNEL").to_string());
|
||||
pub static ref RELEASE_CHANNEL: ReleaseChannel = match RELEASE_CHANNEL_NAME.as_str() {
|
||||
"dev" => ReleaseChannel::Dev,
|
||||
"preview" => ReleaseChannel::Preview,
|
||||
"stable" => ReleaseChannel::Preview,
|
||||
_ => panic!("invalid release channel {RELEASE_CHANNEL_NAME}"),
|
||||
_ => panic!("invalid release channel {}", *RELEASE_CHANNEL_NAME),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue