summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorLeo K <crowlkats@toaxl.com>2021-08-04 21:47:43 +0200
committerGitHub <noreply@github.com>2021-08-04 21:47:43 +0200
commit2ac031d6fd3cb9b98ffb1801033d96675291f577 (patch)
treee5ad7c2de4d7aa1dae09e57e6e70917eb313c972 /runtime/js
parent1cd95dd8b5046484ea79b1849e420d1c085d1e5b (diff)
feat(unstable): clean environmental variables for subprocess (#11571)
This commit adds "Deno.RunOptions.clearEnv" option, that allows to clear environmental variables from parent process before spawning a subprocess.
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/40_process.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js
index 70a590f36..543c53c27 100644
--- a/runtime/js/40_process.js
+++ b/runtime/js/40_process.js
@@ -100,6 +100,7 @@
function run({
cmd,
cwd = undefined,
+ clearEnv = false,
env = {},
stdout = "inherit",
stderr = "inherit",
@@ -111,6 +112,7 @@
const res = opRun({
cmd: ArrayPrototypeMap(cmd, String),
cwd,
+ clearEnv,
env: ObjectEntries(env),
stdin: isRid(stdin) ? "" : stdin,
stdout: isRid(stdout) ? "" : stdout,