mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor(ops/process): add StdioOrRid
enum (#14393)
This commit is contained in:
parent
dc4ab1d934
commit
3c7c586577
4 changed files with 90 additions and 72 deletions
|
@ -11,7 +11,6 @@
|
|||
ArrayPrototypeMap,
|
||||
ArrayPrototypeSlice,
|
||||
TypeError,
|
||||
isNaN,
|
||||
ObjectEntries,
|
||||
String,
|
||||
} = window.__bootstrap.primordials;
|
||||
|
@ -95,10 +94,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
function isRid(arg) {
|
||||
return !isNaN(arg);
|
||||
}
|
||||
|
||||
function run({
|
||||
cmd,
|
||||
cwd = undefined,
|
||||
|
@ -120,12 +115,9 @@
|
|||
env: ObjectEntries(env),
|
||||
gid,
|
||||
uid,
|
||||
stdin: isRid(stdin) ? "" : stdin,
|
||||
stdout: isRid(stdout) ? "" : stdout,
|
||||
stderr: isRid(stderr) ? "" : stderr,
|
||||
stdinRid: isRid(stdin) ? stdin : 0,
|
||||
stdoutRid: isRid(stdout) ? stdout : 0,
|
||||
stderrRid: isRid(stderr) ? stderr : 0,
|
||||
stdin,
|
||||
stdout,
|
||||
stderr,
|
||||
});
|
||||
return new Process(res);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue