forked from projects/fipamo
added directory check to init when making index md file
This commit is contained in:
parent
575fea388b
commit
ad09a61ab7
1 changed files with 9 additions and 7 deletions
|
@ -206,13 +206,15 @@ router.post('/init', function (req, res) {
|
||||||
'---\n' +
|
'---\n' +
|
||||||
index.content;
|
index.content;
|
||||||
|
|
||||||
fs.writeFile('content/pages/index.md', init)
|
fs.ensureDir('content/pages/').then(() => {
|
||||||
.then(() => {
|
fs.writeFile('content/pages/index.md', init)
|
||||||
console.log('index file created');
|
.then(() => {
|
||||||
})
|
//console.log('index file created');
|
||||||
.catch(err => {
|
})
|
||||||
console.log('ERROR', err);
|
.catch(() => {
|
||||||
});
|
//console.log('ERROR', err);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
|
Loading…
Reference in a new issue