fix: handle errors when fixing permissions

This commit is contained in:
James Murdza 2024-09-29 17:40:09 -07:00
parent c94678c430
commit 69b1287349

View File

@ -171,9 +171,13 @@ io.on("connection", async (socket) => {
// Change the owner of the project directory to user // Change the owner of the project directory to user
const fixPermissions = async (projectDirectory: string) => { const fixPermissions = async (projectDirectory: string) => {
try {
await containers[data.sandboxId].commands.run( await containers[data.sandboxId].commands.run(
`sudo chown -R user "${projectDirectory}"` `sudo chown -R user "${projectDirectory}"`
); );
} catch (e: any) {
console.log("Failed to fix permissions: " + e);
}
}; };
// Copy all files from the project to the container // Copy all files from the project to the container