Skip to content

Commit 4817db4

Browse files
committed
fix: Create directories when writing JSON output
Discovered under #1571
1 parent 0524305 commit 4817db4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/application.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
CallbackLogger,
1313
PluginHost,
1414
normalizePath,
15+
ensureDirectoriesExist,
1516
} from "./utils/index";
1617
import { createMinimatch } from "./utils/paths";
1718

@@ -405,6 +406,7 @@ export class Application extends ChildableComponent<
405406
});
406407

407408
const space = this.application.options.getValue("pretty") ? "\t" : "";
409+
ensureDirectoriesExist(Path.dirname(out));
408410
await FS.promises.writeFile(out, JSON.stringify(ser, null, space));
409411
this.logger.success("JSON written to %s", out);
410412
}

0 commit comments

Comments
 (0)