Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into handle-symbolic-links-that-dont-exist

Jonny Burger78204c879199
diff --cc packages/bundler/src/read-recursively.ts
index 1bb615fce0,64a31a89ef..29d6a278bb
--- a/packages/bundler/src/read-recursively.ts
+++ b/packages/bundler/src/read-recursively.ts
@@@ -2,16 -2,17 +2,27 @@@ import fs, {statSync} from 'node:fs'
import path from 'node:path';
import type {StaticFile} from 'remotion';
+// There can be symbolic links that point to files that don't exist.
+// https://github.com/remotion-dev/remotion/issues/2587
+const statOrNull = (p: string) => {
+ try {
+ return statSync(p);
+ } catch (err) {
+ return null;
+ }
+};
+
+ const encodeBySplitting = (p: string): string => {
+ // Intentional: split by path.sep, then join by /
+ const splitBySlash = p.split(path.sep);
+
+ const encodedArray = splitBySlash.map((element) => {
+ return encodeURIComponent(element);
+ });
+ const merged = encodedArray.join('/');
+ return merged;
+ };
+
export const readRecursively = ({
folder,
output = [],