linux: Use optional compile-time RELEASE_VERSION variable (#11490)
This implements `app_version` on Linux by using an optional, compile-time `RELEASE_VERSION` env var that can be set. We settled on the `RELEASE_VERSION` as the name, since it's similar to `RELEASE_CHANNEL` which we use in Zed. cc @ConradIrwin @mikayla-maki Release Notes: - N/A Co-authored-by: Bennet <bennetbo@gmx.de>
This commit is contained in:
parent
33d4c563fb
commit
4eedbdedae
2 changed files with 10 additions and 1 deletions
|
@ -348,7 +348,12 @@ impl<P: LinuxClient + 'static> Platform for P {
|
|||
}
|
||||
|
||||
fn app_version(&self) -> Result<SemanticVersion> {
|
||||
Ok(SemanticVersion::new(1, 0, 0))
|
||||
const VERSION: Option<&str> = option_env!("RELEASE_VERSION");
|
||||
if let Some(version) = VERSION {
|
||||
version.parse()
|
||||
} else {
|
||||
Ok(SemanticVersion::new(1, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
fn app_path(&self) -> Result<PathBuf> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue