Skip to content

Commit 7384304

Browse files
committed
Generate md reports in website folder
1 parent dff6186 commit 7384304

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

generator/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ fn main() -> Result<(), Error> {
2020
let reports_org_path = reports::clone(cli.reports)?;
2121
let reports_org_list = reports::find(reports_org_path)?;
2222
for report in reports_org_list {
23-
dbg!(&report);
24-
let new_md_report = reports::convert(report)?;
25-
dbg!(new_md_report);
23+
let report_md = reports::convert(report, &cli.website)?;
2624
// add_report_to_website(new_md_report)?;
2725
}
2826
Ok(())

generator/src/reports.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::path::PathBuf;
1+
use std::path::{Path, PathBuf};
22
use std::process::Command;
33

44
use std::fs;
@@ -26,8 +26,11 @@ pub fn find(reports_org_path: PathBuf) -> Result<Vec<PathBuf>, Error> {
2626
Ok(results)
2727
}
2828

29-
pub fn convert(report_org_path: PathBuf) -> Result<PathBuf, Error> {
30-
let mut report_md_path = report_org_path.clone();
29+
pub fn convert(report_org_path: PathBuf, website: &Path) -> Result<PathBuf, Error> {
30+
let mut report_md_path = website
31+
.join("reporting")
32+
.join(PathBuf::from(report_org_path.clone().file_name().unwrap()));
33+
dbg!(&report_md_path);
3134
report_md_path.set_extension("md");
3235
Command::new("pandoc")
3336
.arg("--from=org")

0 commit comments

Comments
 (0)