@@ -1,30 +1,9 @@
11use helix_loader::grammar::{build_grammars, fetch_grammars};
2−use std::borrow::Cow;
3−use std::process::Command;
4−
5−const VERSION: &str = include_str!("../VERSION");
62
73fn main() {
8− let git_hash = Command::new("git")
9− .args(["rev-parse", "HEAD"])
10− .output()
11− .ok()
12− .filter(|output| output.status.success())
13− .and_then(|x| String::from_utf8(x.stdout).ok());
14−
15− let version: Cow<_> = match git_hash {
16− Some(git_hash) => format!("{} ({})", VERSION, &git_hash[..8]).into(),
17− None => VERSION.into(),
18− };
19−
204 if std::env::var("HELIX_DISABLE_AUTO_GRAMMAR_BUILD").is_err() {
215 fetch_grammars().expect("Failed to fetch tree-sitter grammars");
226 build_grammars(Some(std::env::var("TARGET").unwrap()))
237 .expect("Failed to compile tree-sitter grammars");
248 }
25−
26− println!("cargo:rerun-if-changed=../runtime/grammars/");
27− println!("cargo:rerun-if-changed=../VERSION");
28−
29− println!("cargo:rustc-env=VERSION_AND_GIT_HASH={}", version);
309}