feat(cli): also create output directory if it doesn't already exist

This commit is contained in:
Jon Heinritz 2025-06-20 08:30:39 +02:00
parent a41f821fa6
commit c4f5ba84d1

View File

@ -137,6 +137,14 @@ impl CompileConfig {
panic!("input path must be non-empty, as guarded by the CLI");
};
// create directory if doesn't exist yet
std::fs::create_dir_all(&path).map_err(|err| {
eco_format!(
"failed to create output directory at {path}: {err}",
path = path.display()
)
})?;
path.push(file_name);
path.set_extension(match output_format {
OutputFormat::Pdf => "pdf",