Distributed database pattern built.

Co-Authored-By: kay@zed.dev
This commit is contained in:
Mikayla Maki 2022-11-14 13:18:44 -08:00
parent 2a5565ca93
commit 4798161118
28 changed files with 893 additions and 937 deletions

View file

@ -0,0 +1,32 @@
use std::env;
use lazy_static::lazy_static;
lazy_static! {
pub static ref RELEASE_CHANNEL_NAME: String = env::var("ZED_RELEASE_CHANNEL")
.unwrap_or(include_str!("../../zed/RELEASE_CHANNEL").to_string());
pub static ref RELEASE_CHANNEL: ReleaseChannel = match RELEASE_CHANNEL_NAME.as_str() {
"dev" => ReleaseChannel::Dev,
"preview" => ReleaseChannel::Preview,
"stable" => ReleaseChannel::Stable,
_ => panic!("invalid release channel {}", *RELEASE_CHANNEL_NAME),
};
}
#[derive(Copy, Clone, PartialEq, Eq, Default)]
pub enum ReleaseChannel {
#[default]
Dev,
Preview,
Stable,
}
impl ReleaseChannel {
pub fn name(&self) -> &'static str {
match self {
ReleaseChannel::Dev => "Zed Dev",
ReleaseChannel::Preview => "Zed Preview",
ReleaseChannel::Stable => "Zed",
}
}
}

View file

@ -1,3 +1,4 @@
pub mod channel;
pub mod paths;
#[cfg(any(test, feature = "test-support"))]
pub mod test;