From f64f14b4d94fd4bd9edc8f44e7875d22bbccfca3 Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Thu, 23 Jan 2025 09:58:01 +0100 Subject: [PATCH] `@remotion/lambda`: Only delete bundle if it exists (may be mocked) --- packages/lambda/src/api/deploy-site.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/lambda/src/api/deploy-site.ts b/packages/lambda/src/api/deploy-site.ts index b548253ad5..b4462a79f8 100644 --- a/packages/lambda/src/api/deploy-site.ts +++ b/packages/lambda/src/api/deploy-site.ts @@ -174,9 +174,11 @@ const mandatoryDeploySite = async ({ ), ]); - fs.rmSync(bundled, { - recursive: true, - }); + if (fs.existsSync(bundled)) { + fs.rmSync(bundled, { + recursive: true, + }); + } return { serveUrl: makeS3ServeUrl({bucketName, subFolder, region}),