FIX MKDIR

This commit is contained in:
Joaquim Peixoto 2021-06-25 20:20:00 +01:00
parent c845d19226
commit 7b84ef1aa0
3 changed files with 24 additions and 1812 deletions

View File

@ -1,3 +0,0 @@
STORAGE_LOCATION=files/
STORAGE_PROVIDER=file
PORT=3003

1793
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ export class FileStorage implements Storage {
} }
async set(path: string, value: any) { async set(path: string, value: any) {
path = join(process.env.STORAGE_LOCATION || "", path); path = join(process.env.STORAGE_LOCATION || "", path).replace(/[\\]/g, "/");
const dir = path.split("/").slice(0, -1).join("/"); const dir = path.split("/").slice(0, -1).join("/");
await fs.mkdir(dir, { recursive: true }).caught(); await fs.mkdir(dir, { recursive: true }).caught();