Skip to content

Commit c08435c

Browse files
committed
add env and run the bin as-is
1 parent f1a5d90 commit c08435c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: src/internal/bootstrap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const bootstrap = async (): Promise<void> => {
1717

1818
const { childProcess, bin, endpoint } = await endpointSpawn(
1919
_HANDLER,
20-
IS_OFFLINE === "true"
20+
process.env
2121
);
2222

2323
try {

Diff for: src/internal/proxy.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const waitForEndpoint = async (
7878

7979
export const endpointSpawn = async (
8080
handler: string,
81-
offline: boolean
81+
env?: NodeJS.ProcessEnv
8282
): Promise<{
8383
childProcess?: ChildProcess;
8484
bin?: string;
@@ -105,19 +105,19 @@ export const endpointSpawn = async (
105105
if (bin && endpoint) {
106106
log("Starting child process", { bin });
107107

108-
const subcommand = offline ? "dev" : "start";
108+
info(`Running: \`${bin}\``);
109109

110-
info(`Running: \`${bin} ${subcommand}\``);
111-
112-
childProcess = spawn(bin, [subcommand], {
110+
const cmds = bin.split(" ");
111+
childProcess = spawn(cmds[0], cmds.slice(1), {
113112
detached: true,
114113
stdio: "inherit",
114+
env: env,
115115
});
116116

117117
// TODO Decide if we should do this...
118118
childProcess.unref();
119119

120-
log("Started child process", { bin, subcommand, pid: childProcess.pid });
120+
log("Started child process", { cmds, pid: childProcess.pid });
121121
}
122122

123123
endpoint = endpoint ? new URL(endpoint) : undefined;

0 commit comments

Comments
 (0)