added directory check to init when making index md file

nodejs-version-freeze
Ro 4 years ago
parent 575fea388b
commit ad09a61ab7

@ -206,12 +206,14 @@ router.post('/init', function (req, res) {
'---\n' +
index.content;
fs.ensureDir('content/pages/').then(() => {
fs.writeFile('content/pages/index.md', init)
.then(() => {
console.log('index file created');
//console.log('index file created');
})
.catch(err => {
console.log('ERROR', err);
.catch(() => {
//console.log('ERROR', err);
});
});
});

Loading…
Cancel
Save