We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ee4c9a commit f15a43bCopy full SHA for f15a43b
src/project/generate_output.rs
@@ -54,7 +54,15 @@ pub async fn generate_output(
54
}
55
56
OutputFormat::Json => {
57
- let json_path = Path::new(output_directory).join("report.json");
+ if let Err(e) = fs::create_dir_all(output_directory).await {
58
+ eprintln!(
59
+ "Error creating output directory {}: {:?}",
60
+ output_directory, e
61
+ );
62
+ return;
63
+ }
64
+
65
+ let json_path = Path::new(output_directory).join("index.json");
66
let mut file = File::create(&json_path)
67
.expect("Failed to create JSON report file");
68
let formatted_json = serde_json::to_string_pretty(&json_data)
0 commit comments