We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
create_dir_all
1 parent 255e03f commit e660953Copy full SHA for e660953
src/generator.rs
@@ -64,6 +64,8 @@ pub(crate) fn generate(
64
minijinja_env.add_template(tpl_path, &tpl_source)?;
65
let tpl = minijinja_env.get_template(tpl_path)?;
66
67
+ fs::create_dir_all(output_dir)?;
68
+
69
let postprocessor = Postprocessor::from_ext(tpl_file_ext, output_dir);
70
71
let generator = Generator {
@@ -174,9 +176,6 @@ impl Generator<'_> {
174
176
175
177
let file_path = self.output_dir.join(format!("{basename}.{tpl_file_ext}"));
178
- if !self.output_dir.exists() {
- fs::create_dir_all(self.output_dir)?;
179
- }
180
let out_file = BufWriter::new(File::create(&file_path)?);
181
182
self.tpl.render_to_write(ctx, out_file)?;
0 commit comments