Skip to content

Commit 86d295a

Browse files
committed
🤖 fix: handle in-place workspaces for script execution
Change-Id: I4cad0fd79ea274da007221385fba7626c66d6da0 Signed-off-by: Thomas Kosiewski <[email protected]>
1 parent 717bc6d commit 86d295a

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
@@ -1206,10 +1206,11 @@ export class IpcMain {
12061206
srcBaseDir: this.config.srcDir,
12071207
};
12081208
const runtimeInstance = createRuntime(runtimeConfig);
1209-
const workspacePath = runtimeInstance.getWorkspacePath(
1210-
metadata.projectPath,
1211-
metadata.name
1212-
);
1209+
// Handle in-place workspaces where projectPath === name
1210+
const isInPlace = metadata.projectPath === metadata.name;
1211+
const workspacePath = isInPlace
1212+
? metadata.projectPath
1213+
: runtimeInstance.getWorkspacePath(metadata.projectPath, metadata.name);
12131214

12141215
const remoteToken = Math.random().toString(16).substring(2, 10);
12151216

@@ -1611,7 +1612,11 @@ export class IpcMain {
16111612
srcBaseDir: this.config.srcDir,
16121613
};
16131614
const runtime = createRuntime(runtimeConfig);
1614-
const workspacePath = runtime.getWorkspacePath(metadata.projectPath, metadata.name);
1615+
// Handle in-place workspaces where projectPath === name
1616+
const isInPlace = metadata.projectPath === metadata.name;
1617+
const workspacePath = isInPlace
1618+
? metadata.projectPath
1619+
: runtime.getWorkspacePath(metadata.projectPath, metadata.name);
16151620

16161621
const scripts = await listScripts(runtime, workspacePath);
16171622
return Ok(scripts);

0 commit comments

Comments
 (0)