diff --git a/src/bin/coco.rs b/src/bin/coco.rs index b38235ff..89b55524 100644 --- a/src/bin/coco.rs +++ b/src/bin/coco.rs @@ -3,6 +3,7 @@ use coco::app::git_app::get_repo; use coco::domain::config::CocoConfig; use coco::infrastructure::name_format; use std::fs; +use std::path::Path; fn main() { let matches = App::new("Coco Program") @@ -27,6 +28,12 @@ fn main() { let results = get_repo(x.url.as_str()); let file_name = name_format::from_url(x.url.as_str()); - fs::write(file_name, results).expect("cannot write file"); + let root = Path::new(".coco"); + let reporter_buf = root.join("reporter"); + let _ = fs::create_dir_all(reporter_buf.clone()); + + let output_file = reporter_buf.join(file_name); + + fs::write(output_file, results).expect("cannot write file"); } }