Skip to content

🎥 Make videos programmatically with React

use fs.promises.rm instead of fs.promises.rmdir

Jonny Burger346f552357ee
diff --git a/packages/bundler/src/webpack-cache.ts b/packages/bundler/src/webpack-cache.ts
index 5816337f51..bb96da57a0 100644
--- a/packages/bundler/src/webpack-cache.ts
+++ b/packages/bundler/src/webpack-cache.ts
@@ -62,12 +62,9 @@ const remotionCacheLocation = (
};
export const clearCache = (remotionRoot: string) => {
- return (fs.promises.rm ?? fs.promises.rmdir)(
- getWebpackCacheDir(remotionRoot),
- {
- recursive: true,
- }
- );
+ return fs.promises.rm(getWebpackCacheDir(remotionRoot), {
+ recursive: true,
+ });
};
const getPrefix = (environment: Environment) => {
diff --git a/packages/it-tests/src/rendering/rendering.test.ts b/packages/it-tests/src/rendering/rendering.test.ts
index ab3c42f61c..116caec533 100644
--- a/packages/it-tests/src/rendering/rendering.test.ts
+++ b/packages/it-tests/src/rendering/rendering.test.ts
@@ -159,7 +159,7 @@ test("Should render a still image if single frame specified", async () => {
const info = await RenderInternals.callFf("ffprobe", [outImg]);
const data = info.stderr;
expect(data).toContain("Video: png");
- await (fs.promises.rm ?? fs.promises.rmdir)(outDir, {
+ await fs.promises.rm(outDir, {
recursive: true,
});
});
diff --git a/packages/lambda/src/functions/helpers/concat-videos.ts b/packages/lambda/src/functions/helpers/concat-videos.ts
index 172ccdaee5..2e713abdc7 100644
--- a/packages/lambda/src/functions/helpers/concat-videos.ts
+++ b/packages/lambda/src/functions/helpers/concat-videos.ts
@@ -210,7 +210,7 @@ export const concatVideosS3 = async ({
});
combine.end();
- const cleanupChunksProm = (fs.promises.rm ?? fs.promises.rmdir)(outdir, {
+ const cleanupChunksProm = fs.promises.rm(outdir, {
recursive: true,
});
return {outfile, cleanupChunksProm};