Skip to content

Commit

Permalink
handle promise error & exit properly (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
endiliey authored and JoelMarcey committed Jun 27, 2018
1 parent c0aa98b commit f598e25
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/build-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@ if (!fs.existsSync(CWD + '/siteConfig.js')) {

// generate all static html files
const generate = require('./server/generate.js');
generate();
console.log("Site built successfully. Generated files in 'build' folder.");
generate()
.then(() => {
console.log("Site built successfully. Generated files in 'build' folder.");
})
.catch(error => {
console.error(error);
process.exit(1);
});

0 comments on commit f598e25

Please sign in to comment.