Skip to content

Commit

Permalink
fix: formatting uses ES module rather than running a shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinEberhardt committed Dec 19, 2022
1 parent 08a14d7 commit e183c43
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,13 @@ async function generate(schemaPathOrUrl, generatorPathOrUrl, options) {
});
log.verbose("\nIteration complete\n");

const currentPath = process.cwd();
shell.cd(generatorPath);
shell.exec(`npm run format:write -- ${outputFolder}`, log.shellOptions);
shell.cd(currentPath, log.shellOptions);

try {
const formatter = require(path.resolve(generatorPath, "./formatter.js"));
formatter(outputFolder, log.getLogLevel());
} catch {
log.error(`No formatter found in ${generatorPath}`);
}
} catch (e) {
exception = e;
} finally {
Expand Down

0 comments on commit e183c43

Please sign in to comment.