fix(cloud): spawn relay client without shell
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
0644077a52
commit
0ccb1efdce
3 files changed
+17
-12
No files matched your search
@@ -106,12 +106,17 @@ describe("CloudManagedEndpointRuntime", () => {
|
||||
|
||||
expect(spawned.map((command) => command.command)).toEqual(["cloudflared", "cloudflared"]);
|
||||
expect(spawned.map((command) => command.args)).toEqual([
|
||||
["tunnel", "run", "--token", "token-1"],
|
||||
["tunnel", "run", "--token", "token-2"],
|
||||
["tunnel", "run"],
|
||||
["tunnel", "run"],
|
||||
]);
|
||||
expect(spawned.map((command) => command.options.env?.TUNNEL_TOKEN)).toEqual([
|
||||
"token-1",
|
||||
"token-2",
|
||||
]);
|
||||
expect(spawned.map((command) => command.options.stdout)).toEqual(["ignore", "ignore"]);
|
||||
expect(spawned.map((command) => command.options.stderr)).toEqual(["ignore", "ignore"]);
|
||||
expect(spawned.map((command) => command.options.detached)).toEqual([false, false]);
|
||||
expect(spawned.map((command) => command.options.shell)).toEqual([false, false]);
|
||||
expect(killed).toEqual([100, 101]);
|
||||
expect(stopped).toEqual({ status: "disabled" });
|
||||
}),
|
||||
|
||||
@@ -185,16 +185,16 @@ export const makeCloudManagedEndpointRuntime = Effect.gen(function* () {
|
||||
const connectorScope = yield* Scope.make("sequential");
|
||||
const child = yield* spawner
|
||||
.spawn(
|
||||
ChildProcess.make(
|
||||
executable.executablePath,
|
||||
["tunnel", "run", "--token", config.connectorToken],
|
||||
{
|
||||
detached: false,
|
||||
shell: process.platform === "win32",
|
||||
stderr: "ignore",
|
||||
stdout: "ignore",
|
||||
ChildProcess.make(executable.executablePath, ["tunnel", "run"], {
|
||||
detached: false,
|
||||
env: {
|
||||
...process.env,
|
||||
TUNNEL_TOKEN: config.connectorToken,
|
||||
},
|
||||
),
|
||||
shell: false,
|
||||
stderr: "ignore",
|
||||
stdout: "ignore",
|
||||
}),
|
||||
)
|
||||
.pipe(
|
||||
Effect.provideService(Scope.Scope, connectorScope),
|
||||
|
||||
@@ -292,7 +292,7 @@ export const makeCloudflaredRelayClient = Effect.fn("cloudflared.make")(function
|
||||
) {
|
||||
const child = yield* spawner.spawn(
|
||||
ChildProcess.make(command, args, {
|
||||
shell: platform === "win32",
|
||||
shell: false,
|
||||
stdout: "ignore",
|
||||
stderr: "ignore",
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user