From 8e16d180144fdf9662f47ffabca6ef5b799f73dd Mon Sep 17 00:00:00 2001 From: Abhinav Date: Tue, 25 Apr 2023 16:15:44 +0530 Subject: [PATCH] update moveFile API --- src/services/fs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/fs.ts b/src/services/fs.ts index fdbd73c45..baf05d3fc 100644 --- a/src/services/fs.ts +++ b/src/services/fs.ts @@ -255,7 +255,7 @@ export async function moveFile( // check if destination folder exists const destinationFolder = path.dirname(destinationPath); if (!existsSync(destinationFolder)) { - throw new Error('Destination folder does not exist'); + await fs.mkdir(destinationFolder, { recursive: true }); } await fs.rename(sourcePath, destinationPath); }