From 13414612090c61a6f31cb8504a969e3c405568c3 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Wed, 22 Aug 2018 12:10:44 +0200 Subject: [PATCH] Remove stdfork from processes.ts --- src/vs/base/node/processes.ts | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/vs/base/node/processes.ts b/src/vs/base/node/processes.ts index c08d79aaf2d..53f90f70954 100644 --- a/src/vs/base/node/processes.ts +++ b/src/vs/base/node/processes.ts @@ -6,7 +6,6 @@ import * as path from 'path'; import * as cp from 'child_process'; -import { fork } from 'vs/base/node/stdFork'; import * as nls from 'vs/nls'; import { TPromise, TValueCallback, ErrorCallback } from 'vs/base/common/winjs.base'; import * as Types from 'vs/base/common/types'; @@ -74,7 +73,6 @@ export function getWindowsShell(): string { export abstract class AbstractProcess { private cmd: string; - private module: string; private args: string[]; private options: CommandOptions | ForkOptions; protected shell: boolean; @@ -107,18 +105,12 @@ export abstract class AbstractProcess { public constructor(executable: Executable); public constructor(cmd: string, args: string[], shell: boolean, options: CommandOptions); - public constructor(module: string, args: string[], options: ForkOptions); - public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean | ForkOptions, arg4?: CommandOptions) { - if (arg4) { + public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean, arg4?: CommandOptions) { + if (arg2 !== void 0 && arg3 !== void 0 && arg4 !== void 0) { this.cmd = arg1; this.args = arg2; - this.shell = arg3; + this.shell = arg3; this.options = arg4; - } else if (arg3 && arg2) { - this.module = arg1; - this.args = arg2; - this.shell = false; - this.options = arg3; } else { let executable = arg1; this.cmd = executable.command; @@ -233,24 +225,6 @@ export abstract class AbstractProcess { } else { if (this.cmd) { childProcess = cp.spawn(this.cmd, this.args, this.options); - } else if (this.module) { - this.childProcessPromise = new TPromise((c, e) => { - fork(this.module, this.args, this.options, (error: any, childProcess: cp.ChildProcess) => { - if (error) { - e(error); - ee({ terminated: this.terminateRequested, error: error }); - return; - } - this.childProcess = childProcess; - if (this.pidResolve) { - this.pidResolve(Types.isNumber(childProcess.pid) ? childProcess.pid : -1); - this.pidResolve = undefined; - } - this.childProcess.on('close', closeHandler); - this.handleSpawn(childProcess, cc, pp, ee, false); - c(childProcess); - }); - }); } } if (childProcess) { @@ -345,7 +319,6 @@ export class LineProcess extends AbstractProcess { public constructor(executable: Executable); public constructor(cmd: string, args: string[], shell: boolean, options: CommandOptions); - public constructor(module: string, args: string[], options: ForkOptions); public constructor(arg1: string | Executable, arg2?: string[], arg3?: boolean | ForkOptions, arg4?: CommandOptions) { super(arg1, arg2, arg3, arg4); } -- GitLab