Skip to content

Commit 6330cb4

Browse files
authored
Merge pull request #421 from olaservo/reverse-env-order-for-cli-stdio
Reverse env variable sourcing order
2 parents 24ef319 + 44b4417 commit 6330cb4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cli/src/transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function createStdioTransport(options: TransportOptions): Transport {
3232
const defaultEnv = getDefaultEnvironment();
3333

3434
const env: Record<string, string> = {
35-
...processEnv,
3635
...defaultEnv,
36+
...processEnv,
3737
};
3838

3939
const { cmd: actualCommand, args: actualArgs } = findActualExecutable(

server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const createTransport = async (req: express.Request): Promise<Transport> => {
184184
const command = query.command as string;
185185
const origArgs = shellParseArgs(query.args as string) as string[];
186186
const queryEnv = query.env ? JSON.parse(query.env as string) : {};
187-
const env = { ...process.env, ...defaultEnvironment, ...queryEnv };
187+
const env = { ...defaultEnvironment, ...process.env, ...queryEnv };
188188

189189
const { cmd, args } = findActualExecutable(command, origArgs);
190190

0 commit comments

Comments
 (0)