diff --git a/index.js b/index.js index fc8a5c3..3e71a65 100644 --- a/index.js +++ b/index.js @@ -2,15 +2,10 @@ const wizard = require('./src/wizard'); const parser = require('./src/parser'); const writer = require('./src/writer'); -async function init() { - try { - config = wizard.getConfig(); - let posts = await parser.parseFilePromise(config) - await writer.writeFilesPromise(posts, config); - } catch (ex) { - // appease the UnhandledPromiseRejectionWarning - console.error(ex); - } -} - -init(); +(async () => { + config = wizard.getConfig(); + let posts = await parser.parseFilePromise(config) + await writer.writeFilesPromise(posts, config); +})().catch(ex => { + console.error(ex); +});