Skip to content

Commit d1148dc

Browse files
committed
create target directory
1 parent 4fa352c commit d1148dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mdbook-goals/src/json.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ pub(super) fn generate_json(
3838

3939
if let Some(json_path) = json_path {
4040
let json = serde_json::to_string(&issues)?;
41+
if let Some(parent) = json_path.parent() {
42+
std::fs::create_dir_all(parent)?;
43+
}
4144
std::fs::write(json_path, json)?;
4245
} else {
4346
println!("{}", serde_json::to_string_pretty(&issues)?);

0 commit comments

Comments
 (0)