create dir if not exist
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = async function(context) {
|
|||||||
log.info('preparing files paths')
|
log.info('preparing files paths')
|
||||||
const dest = context.config.target.filesPath
|
const dest = context.config.target.filesPath
|
||||||
if (!dest || !fs.existsSync(dest)) {
|
if (!dest || !fs.existsSync(dest)) {
|
||||||
fs.mkdirSync(dest)
|
fs.mkdirSync(dest, { recursive: true })
|
||||||
}
|
}
|
||||||
if (!fs.lstatSync(dest).isDirectory() || fs.accessSync(dest, fs.constants.W_OK)) {
|
if (!fs.lstatSync(dest).isDirectory() || fs.accessSync(dest, fs.constants.W_OK)) {
|
||||||
throw new Error(`Directory "${dest} is not writable"`)
|
throw new Error(`Directory "${dest} is not writable"`)
|
||||||
|
|||||||
Reference in New Issue
Block a user