Changed output

This commit is contained in:
Brandon Rozek 2024-07-28 19:52:23 -07:00
parent edc4007ef2
commit a387ba495e
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480

View file

@ -5,14 +5,14 @@ use tera::Tera;
use tera::Context; use tera::Context;
fn main() { fn main() {
println!("Hello, world!");
let mut tera = Tera::default(); let mut tera = Tera::default();
tera.add_template_file("src/toot.md", None).unwrap(); tera.add_template_file("src/toot.md", None).unwrap();
let data_dir = std::fs::read_dir("../.data") let data_dir = std::fs::read_dir("../.data")
.expect("Failed to open data directory"); .expect("Failed to open data directory");
let mut count = 0;
for entry in data_dir { for entry in data_dir {
let opath = entry.ok().map(|v| v.path()); let opath = entry.ok().map(|v| v.path());
@ -59,6 +59,10 @@ fn main() {
file.write_all(output.as_bytes()) file.write_all(output.as_bytes())
.expect("Failed to write to markdown file"); .expect("Failed to write to markdown file");
count += 1;
} }
println!("Successfully generated {} Markdown Files", count);
} }