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

@ -43,7 +43,7 @@ use std::{
use theme::ActiveTheme;
use util::{
async_maybe,
channel::{parse_zed_link, ReleaseChannel, RELEASE_CHANNEL},
channel::{parse_zed_link, AppCommitSha, ReleaseChannel, RELEASE_CHANNEL},
http::{self, HttpClient},
paths, ResultExt,
};
@ -113,6 +113,10 @@ fn main() {
app.run(move |cx| {
cx.set_global(*RELEASE_CHANNEL);
if let Some(build_sha) = option_env!("ZED_COMMIT_SHA") {
cx.set_global(AppCommitSha(build_sha.into()))
}
cx.set_global(listener.clone());
load_embedded_fonts(cx);