mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Refactor init
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user