fix: use posix paths when converting paths to relative format

This commit is contained in:
James Murdza 2024-11-03 12:28:17 -06:00
parent 474102aa14
commit c669babb2f

View File

@ -143,7 +143,7 @@ export class FileManager {
// Reload file list from the container to include template files // 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 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 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); this.files = generateFileStructure(relativePaths);
// Make the logged in user the owner of all project files // Make the logged in user the owner of all project files