Refactor init

This commit is contained in:
Will Boyd
2019-12-21 16:07:52 -05:00
parent be2c62f06c
commit 1b2153ad8b
+7 -12
View File
@@ -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);
});