mirror of https://github.com/dilllxd/gitfolio.git
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:
parent
b194b6758b
commit
8feb05f808
6
blog.js
6
blog.js
|
@ -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 });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue