Skip to content

An open-source, self-hosted system for apps built with web technologies.

Use native Windows shell spawning and valid command fixture paths

zohayrslileh11a8ec3561b0
diff --git a/source/server/core/shell.ts b/source/server/core/shell.ts
index 133af44..dd1c35b 100644
--- a/source/server/core/shell.ts
+++ b/source/server/core/shell.ts
@@ -46,7 +46,7 @@ export default function shell(command: string, options: ShellOptions = {}): Asyn
}
const child = spawn(input.command, {
shell: true,
- detached: true,
+ detached: process.platform !== "win32",
cwd: input.cwd,
env: { ...process.env, ...input.env },
stdio: ["ignore", "pipe", "pipe"]
diff --git a/source/server/view/server-runtime/command.ts b/source/server/view/server-runtime/command.ts
index f8fca23..78e494a 100644
--- a/source/server/view/server-runtime/command.ts
+++ b/source/server/view/server-runtime/command.ts
@@ -24,7 +24,7 @@ export default class CommandServerRuntime implements ServerRuntime {
shell: true,
- detached: true,
+ detached: process.platform !== "win32",
cwd: directory,
diff --git a/tests/worker-runtime.test.ts b/tests/worker-runtime.test.ts
index 365d8f3..f7550c1 100644
--- a/tests/worker-runtime.test.ts
+++ b/tests/worker-runtime.test.ts
@@ -84,7 +84,7 @@ test("worker runtime contract", async () => {
assert.equal(ending.signal, null)
- const command = new CommandServerRuntime(`node ${JSON.stringify(commandEntry)}`, directory)
+ const command = new CommandServerRuntime(`"${process.execPath}" "${commandEntry}"`, directory)
const commandMessages: unknown[][] = []
const commandOutput: ["out" | "err", string][] = []