Skip to content

Commit 9a1558e

Browse files
author
John Doe
committed
refactor: wip
1 parent 0a5170f commit 9a1558e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/nx-plugin/src/executors/cli/executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default async function runAutorunExecutor(
4949
await executeProcess({
5050
command,
5151
args: [...positionals, ...args],
52-
...(envVariables && { env: envVariables }),
52+
env: envVariables,
5353
...(cwd ? { cwd } : {}),
5454
});
5555
} catch (error) {

packages/utils/src/lib/execute-process.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ export function executeProcess(cfg: ProcessConfig): Promise<ProcessResult> {
170170
bin,
171171
() =>
172172
new Promise((resolve, reject) => {
173+
const mergedEnv = env ? { ...process.env, ...env } : undefined;
173174
const spawnedProcess = spawn(command, args ?? [], {
174175
// shell:true tells Windows to use shell command for spawning a child process
175176
// https://stackoverflow.com/questions/60386867/node-spawn-child-process-not-working-in-windows
176177
shell: true,
177-
...(env && { env: env as Record<string, string> }),
178+
...(mergedEnv && { env: mergedEnv as Record<string, string> }),
178179
...(cwd && { cwd: cwd as string }),
179180
...options,
180181
}) as ChildProcessByStdio<Writable, Readable, Readable>;

0 commit comments

Comments
 (0)