Skip to content

Commit

Permalink
fix: Create directories when writing JSON output
Browse files Browse the repository at this point in the history
Discovered under #1571
  • Loading branch information
Gerrit0 committed Apr 23, 2021
1 parent 0524305 commit 4817db4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/application.ts
Expand Up @@ -12,6 +12,7 @@ import {
CallbackLogger,
PluginHost,
normalizePath,
ensureDirectoriesExist,
} from "./utils/index";
import { createMinimatch } from "./utils/paths";

Expand Down Expand Up @@ -405,6 +406,7 @@ export class Application extends ChildableComponent<
});

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

0 comments on commit 4817db4

Please sign in to comment.