Skip to content

Commit

Permalink
Make sure docgen script exits correctly on error
Browse files Browse the repository at this point in the history
  • Loading branch information
taylortom committed Nov 8, 2023
1 parent 11e1201 commit 479c59a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/docgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ async function copyRootFiles() {
async function docs() {
console.log(`Generating documentation for ${app.pkg.name}@${app.pkg.version}`);

await app.onReady();

try {
await app.onReady();
} catch(e) {
console.log(`App failed to start, cannot continue.\n${e}`);
process.exit(1);
}
const config = await app.waitForModule('config');
const { name } = JSON.parse(await fs.readFile(new URL('../package.json', import.meta.url)));
outputdir = path.resolve(process.cwd(), config.get(`${name}.outputDir`));
Expand Down

0 comments on commit 479c59a

Please sign in to comment.