summaryrefslogtreecommitdiff
path: root/src/bin/generate_readme.rs
diff options
context:
space:
mode:
authorCarol (Nichols || Goulding) <carol.nichols@gmail.com>2018-03-04 14:13:55 -0500
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>2018-03-04 14:13:55 -0500
commit426e5cf3f5aa7f65fb13d6884c1bf85e3e195ebd (patch)
tree612e56e1a7fa65480744a59a7e6adc501ff6b280 /src/bin/generate_readme.rs
parent70aa18699bf5f9d6ba8692c52806387506623f6f (diff)
Don't be lazy, actually read the file instead of including it at compile time
Diffstat (limited to 'src/bin/generate_readme.rs')
-rw-r--r--src/bin/generate_readme.rs7
1 files 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();