use built;
use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;
fn main() {
let git_hooks = format!(
"git config core.hooksPath {}",
PathBuf::from("./.hooks").to_str().unwrap()
);
if cfg!(target_os = "windows") {
Command::new("cmd")
.args(&["/C", &git_hooks])
.output()
.expect("failed to execute git config for hooks");
} else {
Command::new("sh")
.args(&["-c", &git_hooks])
.output()
.expect("failed to execute git config for hooks");
}
let out_dir_path = format!("{}{}", env::var("OUT_DIR").unwrap(), "/built.rs");
let _ = built::write_built_file_with_opts(
Some(Path::new(env!("CARGO_MANIFEST_DIR"))),
Path::new(&out_dir_path),
);
}