Use async fileExists

This commit is contained in:
HaveAGitGat 2024-06-01 08:27:41 +01:00
parent 99160eadb3
commit 28192d7723
5 changed files with 21 additions and 15 deletions

View file

@ -1,6 +1,7 @@
import fs from 'fs';
import fileMoveOrCopy from '../../../../FlowHelpers/1.0.0/fileMoveOrCopy';
import {
fileExists,
getContainer, getFileAbosluteDir, getFileName,
} from '../../../../FlowHelpers/1.0.0/fileUtils';
import {
@ -76,7 +77,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
// delete original file
if (
fs.existsSync(args.originalLibraryFile._id)
await fileExists(args.originalLibraryFile._id)
&& args.originalLibraryFile._id !== currentPath
) {
args.jobLog(`Deleting original file:${args.originalLibraryFile._id}`);