Don't be lazy, actually read the file instead of including it at compile time
This commit is contained in:
parent
70aa18699b
commit
426e5cf3f5
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue