chore: fix file paths
This commit is contained in:
parent
930519515c
commit
77265dde28
@ -192,7 +192,7 @@ io.on("connection", async (socket) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const sandboxFiles = await getSandboxFiles(data.sandboxId);
|
const sandboxFiles = await getSandboxFiles(data.sandboxId);
|
||||||
const projectDirectory = path.join(dirName, "projects", data.sandboxId);
|
const projectDirectory = path.posix.join(dirName, "projects", data.sandboxId);
|
||||||
const containerFiles = containers[data.sandboxId].files;
|
const containerFiles = containers[data.sandboxId].files;
|
||||||
const fileWatchers: WatchHandle[] = [];
|
const fileWatchers: WatchHandle[] = [];
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ io.on("connection", async (socket) => {
|
|||||||
// Copy all files from the project to the container
|
// Copy all files from the project to the container
|
||||||
const promises = sandboxFiles.fileData.map(async (file) => {
|
const promises = sandboxFiles.fileData.map(async (file) => {
|
||||||
try {
|
try {
|
||||||
const filePath = path.join(dirName, file.id);
|
const filePath = path.posix.join(dirName, file.id);
|
||||||
const parentDirectory = path.dirname(filePath);
|
const parentDirectory = path.dirname(filePath);
|
||||||
if (!containerFiles.exists(parentDirectory)) {
|
if (!containerFiles.exists(parentDirectory)) {
|
||||||
await containerFiles.makeDir(parentDirectory);
|
await containerFiles.makeDir(parentDirectory);
|
||||||
@ -254,7 +254,7 @@ io.on("connection", async (socket) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is the absolute file path in the container
|
// This is the absolute file path in the container
|
||||||
const containerFilePath = path.join(directory, event.name);
|
const containerFilePath = path.posix.join(directory, event.name);
|
||||||
// This is the file path relative to the home directory
|
// This is the file path relative to the home directory
|
||||||
const sandboxFilePath = removeDirName(containerFilePath, dirName + "/");
|
const sandboxFilePath = removeDirName(containerFilePath, dirName + "/");
|
||||||
// This is the directory being watched relative to the home directory
|
// This is the directory being watched relative to the home directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user