Fix for ./dist/blog initialization issue (#48)

When I went to create a blog for the first time, it kept throwing an error due to the fact that ./dist/blog did not exist. The recursive argument in the fs.mkdirSync function should have created it, but didn't. With this change, it now works on my system.
This commit is contained in:
Zachary P. Brasseaux 2019-05-21 12:05:41 -05:00 committed by imfunny
parent b194b6758b
commit 8feb05f808
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,12 @@ program
.parse(process.argv);
function createBlog(title, subtitle, pagetitle, folder) {
// Checks to make sure this directory actually exists
// and creates it if it doesn't
if (!fs.existsSync(`./dist/blog/`)){
fs.mkdirSync(`./dist/blog/`, { recursive: true }, err => {});
}
if (!fs.existsSync(`./dist/blog/${folder}`)){
fs.mkdirSync(`./dist/blog/${folder}`, { recursive: true });
}