recursive mkdir for uploads directory
This commit is contained in:
parent
add3197d65
commit
deb57d26cc
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ export const attachmentUploadDirectory = path.resolve(process.env.ATTACHMENT_UPL
|
||||||
const ensureDirectory = (dir: string) => {
|
const ensureDirectory = (dir: string) => {
|
||||||
const stats = statSync(dir, { throwIfNoEntry: false });
|
const stats = statSync(dir, { throwIfNoEntry: false });
|
||||||
if (!stats) {
|
if (!stats) {
|
||||||
mkdirSync(dir, { mode: uploadsDirectoryMode });
|
mkdirSync(dir, { mode: uploadsDirectoryMode, recursive: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!stats.isDirectory()) {
|
if (!stats.isDirectory()) {
|
||||||
|
|
Loading…
Reference in a new issue