1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-01 19:02:22 +01:00

Rerun build script only when necessary

This commit is contained in:
cyqsimon
2023-11-02 23:59:20 +08:00
parent 9f7d70f642
commit 7cfd1e0d78

View File

@@ -199,6 +199,8 @@ fn read_all_mappings() -> anyhow::Result<MappingList> {
/// Build the static syntax mappings defined in /src/syntax_mapping/builtins/
/// into a .rs source file, which is to be inserted with `include!`.
pub fn build_static_mappings() -> anyhow::Result<()> {
println!("cargo:rerun-if-changed=src/syntax_mapping/builtins/");
let mappings = read_all_mappings()?;
let codegen_path = Path::new(&env::var_os("OUT_DIR").ok_or(anyhow!("OUT_DIR is unset"))?)