mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-28 21:20:23 +03:00
eeb3f8e963
helix-syntax mostly existed for the sake of the build task which checks and compiles the submodules. Since we won't be relying on that process anymore, it doesn't end up making much sense to have a very thin crate just for some functions that we could port to helix-core. The remaining build-related code is moved to helix-term which will be able to provide grammar builds through the --build-grammars CLI flag.
24 lines
650 B
Rust
24 lines
650 B
Rust
use std::borrow::Cow;
|
|
use std::process::Command;
|
|
|
|
fn main() {
|
|
let git_hash = Command::new("git")
|
|
.args(&["rev-parse", "HEAD"])
|
|
.output()
|
|
.ok()
|
|
.filter(|output| output.status.success())
|
|
.and_then(|x| String::from_utf8(x.stdout).ok());
|
|
|
|
let version: Cow<_> = match git_hash {
|
|
Some(git_hash) => format!("{} ({})", env!("CARGO_PKG_VERSION"), &git_hash[..8]).into(),
|
|
None => env!("CARGO_PKG_VERSION").into(),
|
|
};
|
|
|
|
println!(
|
|
"cargo:rustc-env=BUILD_TARGET={}",
|
|
std::env::var("TARGET").unwrap()
|
|
);
|
|
|
|
println!("cargo:rustc-env=VERSION_AND_GIT_HASH={}", version);
|
|
}
|