We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a5d659 commit 7b61dccCopy full SHA for 7b61dcc
src/shells.ts
@@ -305,9 +305,11 @@ function runCommandAsUser(
305
}
306
307
// TODO: use a new shell API that natively supports cwd & env
308
- let commandWithEnv = `env ${Object.entries(env ?? {})
309
- .map(([key, value]) => `${key}=${value}`)
310
- .join(" ")} ${command}`;
+ let commandWithEnv = Object.keys(env ?? {}).length
+ ? `env ${Object.entries(env ?? {})
+ .map(([key, value]) => `${key}=${value}`)
311
+ .join(" ")} ${command}`
312
+ : command;
313
314
if (cwd) {
315
commandWithEnv = `cd ${cwd} && ${commandWithEnv}`;
0 commit comments