mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 05:13:32 +00:00
refactor: minor code cleanups
This commit is contained in:
committed by
Carlos Valente
parent
0335da9786
commit
20503de6fd
@@ -1,6 +1,7 @@
|
||||
import multer from 'multer';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { rm } from 'fs/promises';
|
||||
|
||||
import { ensureDirectory } from './fileManagement.js';
|
||||
import { getAppDataPath, uploadsFolderPath } from '../setup/index.js';
|
||||
@@ -56,3 +57,11 @@ export const storage = multer.diskStorage({
|
||||
cb(null, file.originalname);
|
||||
},
|
||||
});
|
||||
|
||||
export async function clearUploadfolder() {
|
||||
try {
|
||||
await rm(uploadsFolderPath, { recursive: true });
|
||||
} catch (_) {
|
||||
//we dont care that there was no folder
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user