Skip to content

Commit

Permalink
fix no sunch file or dir when mauanlly gen test driver (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash authored Sep 24, 2024
1 parent d655983 commit 496c4b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/moon/src/cli/generate_test_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ fn moonc_gen_test_info(files: &[PathBuf], output_path: &Path) -> anyhow::Result<
.with_context(|| gen_error_message(files))?;
generated.wait()?;

// when mauanlly execute command to generate test driver, we need to create the parent directory
if !output_path.parent().unwrap().exists() {
std::fs::create_dir_all(output_path.parent().unwrap())?;
}

let test_info_json_path = output_path;
std::fs::OpenOptions::new()
.create(true)
Expand Down

0 comments on commit 496c4b7

Please sign in to comment.