summary refs log tree commit diff
path: root/src/cdn/util/FileStorage.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 18:24:21 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 23:35:18 +1000
commitf44f5d7ac2d24ff836c2e1d4b2fa58da04b13052 (patch)
treea6655c41bb3db79c30fd876b06ee60fe9cf70c9b /src/cdn/util/FileStorage.ts
parentAllow edited_timestamp to passthrough in handleMessage (diff)
downloadserver-f44f5d7ac2d24ff836c2e1d4b2fa58da04b13052.tar.xz
Refactor to mono-repo + upgrade packages
Diffstat (limited to '')
-rw-r--r--src/cdn/util/FileStorage.ts (renamed from cdn/src/util/FileStorage.ts)5
1 files changed, 2 insertions, 3 deletions
diff --git a/cdn/src/util/FileStorage.ts b/src/cdn/util/FileStorage.ts

index 84ecf556..955c570b 100644 --- a/cdn/src/util/FileStorage.ts +++ b/src/cdn/util/FileStorage.ts
@@ -1,10 +1,9 @@ import { Storage } from "./Storage"; import fs from "fs"; -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"); +import ExifTransformer from "exif-be-gone"; // TODO: split stored files into separate folders named after cloned route @@ -36,7 +35,7 @@ export class FileStorage implements Storage { async set(path: string, value: any) { path = getPath(path); - fse.ensureDirSync(dirname(path)); + if (!fs.existsSync(dirname(path))) fs.mkdirSync(dirname(path)); value = Readable.from(value); const cleaned_file = fs.createWriteStream(path);