use std::{fs, path::Path};
fn main() {
let mut cf_template = fs::read_to_string("src/templates/setupTemplate.json")
.expect("Something went wrong reading the CloudFormation template.");
cf_template.pop();
let cf_template_const = format!(
"{}\n{}{}\n{}\n",
r"// AUTO-GENERATED CODE. DO NOT EDIT THIS FILE.",
r#"pub const SETUP_TEMPLATE: &str = r##""#,
cf_template,
r###""##;"###,
);
let dest_path = Path::new("src").join("template.rs");
fs::write(&dest_path, cf_template_const).unwrap();
println!("cargo:rerun-if-changed=src/templates/setupTemplate.json");
println!("cargo:rerun-if-changed=build.rs");
}