Skip to content

Commit 0189099

Browse files
committed
🤖 fix: handle in-place workspaces for script execution
Change-Id: I4cad0fd79ea274da007221385fba7626c66d6da0 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent a1cb0ea commit 0189099

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/node/services/ipcMain.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,10 +1248,11 @@ export class IpcMain {
12481248
srcBaseDir: this.config.srcDir,
12491249
};
12501250
const runtimeInstance = createRuntime(runtimeConfig);
1251-
const workspacePath = runtimeInstance.getWorkspacePath(
1252-
metadata.projectPath,
1253-
metadata.name
1254-
);
1251+
// Handle in-place workspaces where projectPath === name
1252+
const isInPlace = metadata.projectPath === metadata.name;
1253+
const workspacePath = isInPlace
1254+
? metadata.projectPath
1255+
: runtimeInstance.getWorkspacePath(metadata.projectPath, metadata.name);
12551256

12561257
const remoteToken = Math.random().toString(16).substring(2, 10);
12571258

@@ -1671,7 +1672,11 @@ export class IpcMain {
16711672
srcBaseDir: this.config.srcDir,
16721673
};
16731674
const runtime = createRuntime(runtimeConfig);
1674-
const workspacePath = runtime.getWorkspacePath(metadata.projectPath, metadata.name);
1675+
// Handle in-place workspaces where projectPath === name
1676+
const isInPlace = metadata.projectPath === metadata.name;
1677+
const workspacePath = isInPlace
1678+
? metadata.projectPath
1679+
: runtime.getWorkspacePath(metadata.projectPath, metadata.name);
16751680

16761681
const scripts = await listScripts(runtime, workspacePath);
16771682
return Ok(scripts);

0 commit comments

Comments
 (0)