mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
refactor: load project
This commit is contained in:
committed by
Carlos Valente
parent
9c5e403b18
commit
751c3329f0
@@ -1,11 +1,10 @@
|
||||
import multer from 'multer';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { rename, rm } from 'fs/promises';
|
||||
import { rm } from 'fs/promises';
|
||||
|
||||
import { ensureDirectory } from './fileManagement.js';
|
||||
import { getAppDataPath, uploadsFolderPath } from '../setup/index.js';
|
||||
import { deleteFile } from './parserUtils.js';
|
||||
|
||||
function generateNewFileName(filePath: string, callback: (newName: string) => void) {
|
||||
const baseName = path.basename(filePath, path.extname(filePath));
|
||||
@@ -69,14 +68,3 @@ export async function clearUploadfolder() {
|
||||
// we dont care that there was no folder
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies a file from upload folder to a destination
|
||||
* @param filePath
|
||||
* @param name
|
||||
* @returns
|
||||
*/
|
||||
export async function moveUploadedFile(fromUpload: string, toDestination: string) {
|
||||
await rename(fromUpload, toDestination);
|
||||
await deleteFile(fromUpload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user