Unified · Split
| @@ -106,12 +106,17 @@ describe("CloudManagedEndpointRuntime", () => { · 105 unmodified lines | ||
| 106 | 106 | |
| 107 | 107 | expect(spawned.map((command) => command.command)).toEqual(["cloudflared", "cloudflared"]); |
| 108 | 108 | expect(spawned.map((command) => command.args)).toEqual([ |
| 109 | − ["tunnel", "run", "--token", "token-1"], | |
| 110 | − ["tunnel", "run", "--token", "token-2"], | |
| 109 | + ["tunnel", "run"], | |
| 110 | + ["tunnel", "run"], | |
| 111 | + ]); | |
| 112 | + expect(spawned.map((command) => command.options.env?.TUNNEL_TOKEN)).toEqual([ | |
| 113 | + "token-1", | |
| 114 | + "token-2", | |
| 111 | 115 | ]); |
| 112 | 116 | expect(spawned.map((command) => command.options.stdout)).toEqual(["ignore", "ignore"]); |
| 113 | 117 | expect(spawned.map((command) => command.options.stderr)).toEqual(["ignore", "ignore"]); |
| 114 | 118 | expect(spawned.map((command) => command.options.detached)).toEqual([false, false]); |
| 119 | + expect(spawned.map((command) => command.options.shell)).toEqual([false, false]); | |
| 115 | 120 | expect(killed).toEqual([100, 101]); |
| 116 | 121 | expect(stopped).toEqual({ status: "disabled" }); |
| 117 | 122 | }), |
| @@ -185,16 +185,16 @@ export const makeCloudManagedEndpointRuntime = Effect.gen(function* () { · 184 unmodified lines | ||
| 185 | 185 | const connectorScope = yield* Scope.make("sequential"); |
| 186 | 186 | const child = yield* spawner |
| 187 | 187 | .spawn( |
| 188 | − ChildProcess.make( | |
| 189 | − executable.executablePath, | |
| 190 | − ["tunnel", "run", "--token", config.connectorToken], | |
| 191 | − { | |
| 192 | − detached: false, | |
| 193 | − shell: process.platform === "win32", | |
| 194 | − stderr: "ignore", | |
| 195 | − stdout: "ignore", | |
| 188 | + ChildProcess.make(executable.executablePath, ["tunnel", "run"], { | |
| 189 | + detached: false, | |
| 190 | + env: { | |
| 191 | + ...process.env, | |
| 192 | + TUNNEL_TOKEN: config.connectorToken, | |
| 196 | 193 | }, |
| 197 | − ), | |
| 194 | + shell: false, | |
| 195 | + stderr: "ignore", | |
| 196 | + stdout: "ignore", | |
| 197 | + }), | |
| 198 | 198 | ) |
| 199 | 199 | .pipe( |
| 200 | 200 | Effect.provideService(Scope.Scope, connectorScope), |
| @@ -292,7 +292,7 @@ export const makeCloudflaredRelayClient = Effect.fn("cloudflared.make")(function · 291 unmodified lines | ||
| 292 | 292 | ) { |
| 293 | 293 | const child = yield* spawner.spawn( |
| 294 | 294 | ChildProcess.make(command, args, { |
| 295 | − shell: platform === "win32", | |
| 295 | + shell: false, | |
| 296 | 296 | stdout: "ignore", |
| 297 | 297 | stderr: "ignore", |
| 298 | 298 | }), |