Update compose.js
If for any reason the `data/blog` directory is not present, the script fails. This change creates the `data/blog` directory if it doesn't yet exist.
This commit is contained in:
parent
e6db5e62cd
commit
ac7d1c29cd
@ -101,6 +101,7 @@ inquirer
|
||||
.replace(/ /g, '-')
|
||||
.replace(/-+/g, '-')
|
||||
const frontMatter = genFrontMatter(answers)
|
||||
if (!fs.existsSync('data/blog', { recursive: true })) fs.mkdirSync('data/blog')
|
||||
const filePath = `data/blog/${fileName ? fileName : 'untitled'}.${
|
||||
answers.extension ? answers.extension : 'md'
|
||||
}`
|
||||
|
Loading…
x
Reference in New Issue
Block a user