Add build SHA to panic reports and zed --version (on nightly/dev) (#24258)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-02-06 02:09:24 -07:00 committed by GitHub
parent f08b1d78ec
commit 69e6910c9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 76 additions and 33 deletions

View file

@ -40,6 +40,7 @@ fn main() {
#[cfg(not(windows))]
fn main() {
use release_channel::{ReleaseChannel, RELEASE_CHANNEL};
use remote::proxy::ProxyLaunchError;
use remote_server::unix::{execute_proxy, execute_run};
@ -72,12 +73,15 @@ fn main() {
}
},
Some(Commands::Version) => {
if let Some(build_sha) = option_env!("ZED_COMMIT_SHA") {
println!("{}", build_sha);
} else {
println!("{}", env!("ZED_PKG_VERSION"));
}
let release_channel = *RELEASE_CHANNEL;
match release_channel {
ReleaseChannel::Stable | ReleaseChannel::Preview => {
println!("{}", env!("ZED_PKG_VERSION"))
}
ReleaseChannel::Nightly | ReleaseChannel::Dev => {
println!("{}", env!("ZED_COMMIT_SHA"))
}
};
std::process::exit(0);
}
None => {