diff options
Diffstat (limited to 'cdn/src/util')
-rw-r--r-- | cdn/src/util/FileStorage.ts | 6 | ||||
-rw-r--r-- | cdn/src/util/Storage.ts | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cdn/src/util/FileStorage.ts b/cdn/src/util/FileStorage.ts index 376ce007..ed007abb 100644 --- a/cdn/src/util/FileStorage.ts +++ b/cdn/src/util/FileStorage.ts @@ -1,8 +1,7 @@ import { Storage } from "./Storage"; import fs from "fs"; -import fse from "fs-extra"; +//import fse from "fs-extra"; import { join, relative, dirname } from "path"; -import "missing-native-js-functions"; import { Readable } from "stream"; import ExifTransformer = require("exif-be-gone"); @@ -36,7 +35,8 @@ export class FileStorage implements Storage { async set(path: string, value: any) { path = getPath(path); - fse.ensureDirSync(dirname(path)); + //fse.ensureDirSync(dirname(path)); + fs.mkdirSync(dirname(path), {recursive: true}); value = Readable.from(value); const cleaned_file = fs.createWriteStream(path); diff --git a/cdn/src/util/Storage.ts b/cdn/src/util/Storage.ts index 89dd5634..728804a0 100644 --- a/cdn/src/util/Storage.ts +++ b/cdn/src/util/Storage.ts @@ -1,6 +1,7 @@ import { FileStorage } from "./FileStorage"; import path from "path"; -import fse from "fs-extra"; +//import fse from "fs-extra"; +import fs from "fs"; import { bgCyan, black } from "picocolors"; import { S3 } from "@aws-sdk/client-s3"; import { S3Storage } from "./S3Storage"; @@ -22,7 +23,8 @@ if (process.env.STORAGE_PROVIDER === "file" || !process.env.STORAGE_PROVIDER) { location = path.join(process.cwd(), "files"); } console.log(`[CDN] storage location: ${bgCyan(`${black(location)}`)}`); - fse.ensureDirSync(location); + //fse.ensureDirSync(location); + fs.mkdirSync(location, {recursive: true}); process.env.STORAGE_LOCATION = location; storage = new FileStorage(); |