Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

Commit

Permalink
CLI should exit process with bad status on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Gaunt committed Sep 13, 2019
1 parent 042dee5 commit 8b0983d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import * as meow from 'meow';
import {buildSiteFromFile} from './index';
import {logger} from './utils/logger';

const cli = meow(`
Usage
Expand All @@ -17,4 +18,14 @@ const cli = meow(`
}
});

buildSiteFromFile(cli.flags.config);
async function run() {
try {
await buildSiteFromFile(cli.flags.config);
} catch (err) {
logger.error('❌ Unable to build site.');
logger.error(err);
process.exit(1);
}
}

run();

0 comments on commit 8b0983d

Please sign in to comment.