From 426e5cf3f5aa7f65fb13d6884c1bf85e3e195ebd Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 4 Mar 2018 14:13:55 -0500 Subject: [PATCH] Don't be lazy, actually read the file instead of including it at compile time --- src/bin/generate_readme.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/generate_readme.rs b/src/bin/generate_readme.rs index a482fc5..a502fea 100644 --- a/src/bin/generate_readme.rs +++ b/src/bin/generate_readme.rs @@ -18,7 +18,10 @@ use std::io::prelude::*; use std::path::PathBuf; fn main() { - let template = include_str!("../../README-template.hbs"); + let mut template_file = File::open("README-template.hbs").unwrap(); + let mut template = String::new(); + template_file.read_to_string(&mut template).unwrap(); + let autogenerated_notice = "This file was autogenerated by the script in src/bin/generate_readme.rs. Please edit either the script or the template in README-template.md in order to make changes here rather than committing the changes directly."; @@ -32,7 +35,7 @@ order to make changes here rather than committing the changes directly."; generated_readme, "{}", hbs.render_template( - template, + &template, &json!({ "autogenerated_notice": autogenerated_notice }), ).unwrap() ).unwrap();