Make the commit sha availabe in the app, via a global

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Kirill <kirill@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-11-17 14:52:43 -08:00
parent a8bea41ad8
commit a03d062120
4 changed files with 29 additions and 7 deletions

View file

@ -1,6 +1,5 @@
use std::env;
use lazy_static::lazy_static;
use std::env;
lazy_static! {
pub static ref RELEASE_CHANNEL_NAME: String = if cfg!(debug_assertions) {
@ -18,6 +17,8 @@ lazy_static! {
};
}
pub struct AppCommitSha(pub String);
#[derive(Copy, Clone, PartialEq, Eq, Default)]
pub enum ReleaseChannel {
#[default]
@ -40,7 +41,6 @@ impl ReleaseChannel {
pub fn dev_name(&self) -> &'static str {
match self {
ReleaseChannel::Dev => "dev",
// TODO kb need to add DB data
ReleaseChannel::Nightly => "nightly",
ReleaseChannel::Preview => "preview",
ReleaseChannel::Stable => "stable",
@ -69,7 +69,6 @@ impl ReleaseChannel {
pub fn release_query_param(&self) -> Option<&'static str> {
match self {
Self::Dev => None,
// TODO kb need to add server handling
Self::Nightly => Some("nightly=1"),
Self::Preview => Some("preview=1"),
Self::Stable => None,