aboutsummaryrefslogtreecommitdiff
path: root/src/build.rs
blob: 3b732412e6ee8b0f295cefe2f76174d77ac35fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
use ructe::{Result, Ructe};
use std::process::Command;

fn main() -> Result<()> {
    Ructe::from_env()?.compile_templates("templates")?;

    let output = Command::new("git").args(&["rev-parse", "HEAD"]).output().unwrap();
    let git_hash = String::from_utf8(output.stdout).unwrap();
    println!("cargo:rustc-env=GITHUB_SHA={}", git_hash);
    Ok(())
}