maj/site/build.rs

16 lines
451 B
Rust

use anyhow::Result;
use ructe::Ructe;
use std::process::Command;
fn main() -> Result<()> {
let mut ructe = Ructe::from_env()?;
let mut statics = ructe.statics()?;
statics.add_files("static")?;
ructe.compile_templates("templates")?;
let output = Command::new("git").args(&["rev-parse", "HEAD"]).output()?;
let git_hash = String::from_utf8(output.stdout)?;
println!("cargo:rustc-env=GITHUB_SHA={}", git_hash);
Ok(())
}