Skip to content

The VS Code of video editing, built for agents.

TypeScript

Fix regex in project directory validation to handle trailing slashes correctly

konstantin-paulusd8431411900d
diff --git a/apps/web/src/projects/host.ts b/apps/web/src/projects/host.ts
index 84b705b0..dce3137a 100644
--- a/apps/web/src/projects/host.ts
+++ b/apps/web/src/projects/host.ts
@@ -142,7 +142,7 @@ export async function openProjectFolder(dir: string): Promise<ProjectInfo> {
const project = await mainBridge.call(MAIN_CHANNELS.PROJECTS_INIT, { dir });
const root = projectsRoot();
- const underRoot = root !== null && project.dir.startsWith(root.replace(/[\/]+$/, '') + '/');
+ const underRoot = root !== null && project.dir.startsWith(root.replace(/\/+$/, '') + '/');
if (!underRoot) await rememberProjectRoot(project.dir, 'single');
return project;