Add spawn() overload which takes options but no args

This commit is contained in:
Ulrich Buchgraber 2018-11-20 13:26:05 +01:00
parent 28e745f92d
commit 73cfb3d8b8
2 changed files with 3 additions and 0 deletions

View File

@ -2655,6 +2655,7 @@ declare module "child_process" {
windowsHide?: boolean;
}
function spawn(command: string, options?: SpawnOptions): ChildProcess;
function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptions): ChildProcess;
interface ExecOptions {

View File

@ -2636,6 +2636,8 @@ async function asyncStreamPipelineFinished() {
{
childProcess.exec("echo test");
childProcess.exec("echo test", { windowsHide: true });
childProcess.spawn("echo");
childProcess.spawn("echo", { windowsHide: true });
childProcess.spawn("echo", ["test"], { windowsHide: true });
childProcess.spawn("echo", ["test"], { windowsHide: true, argv0: "echo-test" });
childProcess.spawn("echo", ["test"], { stdio: [0xdeadbeef, "inherit", undefined, "pipe"] });