Files
LLeMbas-TTY/config/src/version.rs
T
Wez Furlong 57f1aa2785 fixup build to not consider termwiz tags as wezterm tags
CI got broken by the termwiz release.  This commit teaches the
various `git describe --tags` calls to filter to the wezterm
tags which all start with the year.  We're match `20*` which should
be good for the next 79 years.

I've removed the vergen dependency as there was no way to teach it
to do the equivalent matching, and it wasn't a terrible burden
to just inline the git describe call anyway.
2021-03-17 21:02:03 -07:00

25 lines
585 B
Rust

pub fn wezterm_version() -> &'static str {
// See build.rs
env!("WEZTERM_CI_TAG")
}
pub fn wezterm_target_triple() -> &'static str {
// See build.rs
env!("WEZTERM_TARGET_TRIPLE")
}
pub fn running_under_wsl() -> bool {
#[cfg(unix)]
unsafe {
let mut name: libc::utsname = std::mem::zeroed();
if libc::uname(&mut name) == 0 {
let version = std::ffi::CStr::from_ptr(name.version.as_ptr())
.to_string_lossy()
.into_owned();
return version.contains("Microsoft");
}
};
false
}