New Gallery: create directory if doesn't exist!#120
This commit is contained in:
@@ -571,6 +571,19 @@ module.exports = {
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
mkdirpath(dirPath) {
|
||||
// if (!fs.accessSync(dirPath, fs.constants.R_OK | fs.constants.W_OK)) {
|
||||
if (!fs.existsSync(dirPath)){
|
||||
try {
|
||||
fs.mkdirSync(dirPath, { recursive: true });
|
||||
}
|
||||
catch (e) {
|
||||
mkdirpath(path.dirname(dirPath));
|
||||
mkdirpath(dirPath);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user