mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): support input option in spawnSync (#28792)
This commit is contained in:
parent
9bc9faff49
commit
cb00561e97
4 changed files with 99 additions and 3 deletions
|
@ -41,6 +41,9 @@ import {
|
|||
writableStreamForRid,
|
||||
} from "ext:deno_web/06_streams.js";
|
||||
|
||||
// The key for private `input` option for `Deno.Command`
|
||||
const kInputOption = Symbol("kInputOption");
|
||||
|
||||
function opKill(pid, signo, apiName) {
|
||||
op_kill(pid, signo, apiName);
|
||||
}
|
||||
|
@ -404,6 +407,7 @@ function spawnSync(command, {
|
|||
stdout = "piped",
|
||||
stderr = "piped",
|
||||
windowsRawArguments = false,
|
||||
[kInputOption]: input,
|
||||
} = { __proto__: null }) {
|
||||
if (stdin === "piped") {
|
||||
throw new TypeError(
|
||||
|
@ -425,6 +429,7 @@ function spawnSync(command, {
|
|||
extraStdio: [],
|
||||
detached: false,
|
||||
needsNpmProcessState: false,
|
||||
input,
|
||||
});
|
||||
return {
|
||||
success: result.status.success,
|
||||
|
@ -484,4 +489,4 @@ class Command {
|
|||
}
|
||||
}
|
||||
|
||||
export { ChildProcess, Command, kill, Process, run };
|
||||
export { ChildProcess, Command, kill, kInputOption, Process, run };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue