From c669babb2fc732faf08af50e3392a34dd65586fb Mon Sep 17 00:00:00 2001 From: James Murdza Date: Sun, 3 Nov 2024 12:28:17 -0600 Subject: [PATCH] fix: use posix paths when converting paths to relative format --- backend/server/src/FileManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/server/src/FileManager.ts b/backend/server/src/FileManager.ts index 3d62918..abc48f2 100644 --- a/backend/server/src/FileManager.ts +++ b/backend/server/src/FileManager.ts @@ -143,7 +143,7 @@ export class FileManager { // Reload file list from the container to include template files const result = await this.sandbox.commands.run(`find "${this.dirName}" -type f`); // List all files recursively const localPaths = result.stdout.split('\n').filter(path => path); // Split the output into an array and filter out empty strings - const relativePaths = localPaths.map(filePath => path.relative(this.dirName, filePath)); // Convert absolute paths to relative paths + const relativePaths = localPaths.map(filePath => path.posix.relative(this.dirName, filePath)); // Convert absolute paths to relative paths this.files = generateFileStructure(relativePaths); // Make the logged in user the owner of all project files