From 4e09e48958c6260ca7b5d4129a1ce10f90ca5fba Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 13 Feb 2026 17:00:08 +0100 Subject: Hack: split out icons in cdn-ts --- src/cdn/util/FileStorage.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/cdn/util/FileStorage.ts') diff --git a/src/cdn/util/FileStorage.ts b/src/cdn/util/FileStorage.ts index 6f01b3c5..ff7a56ee 100644 --- a/src/cdn/util/FileStorage.ts +++ b/src/cdn/util/FileStorage.ts @@ -74,4 +74,17 @@ export class FileStorage implements Storage { //TODO we should delete the parent directory if empty fs.unlinkSync(getPath(path)); } + + async exists(path: string) { + return fs.existsSync(getPath(path)); + } + + async move(path: string, newPath: string) { + path = getPath(path); + newPath = getPath(newPath); + + if (!fs.existsSync(dirname(newPath))) fs.mkdirSync(dirname(newPath), { recursive: true }); + + fs.renameSync(path, newPath); + } } -- cgit 1.5.1