提交 13414612 编写于 作者: D Dirk Baeumer

Remove stdfork from processes.ts

上级 76f25881
......@@ -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<TProgressData> {
private cmd: string;
private module: string;
private args: string[];
private options: CommandOptions | ForkOptions;
protected shell: boolean;
......@@ -107,18 +105,12 @@ export abstract class AbstractProcess<TProgressData> {
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 = <string>arg1;
this.args = arg2;
this.shell = <boolean>arg3;
this.shell = arg3;
this.options = arg4;
} else if (arg3 && arg2) {
this.module = <string>arg1;
this.args = arg2;
this.shell = false;
this.options = <ForkOptions>arg3;
} else {
let executable = <Executable>arg1;
this.cmd = executable.command;
......@@ -233,24 +225,6 @@ export abstract class AbstractProcess<TProgressData> {
} else {
if (this.cmd) {
childProcess = cp.spawn(this.cmd, this.args, this.options);
} else if (this.module) {
this.childProcessPromise = new TPromise<cp.ChildProcess>((c, e) => {
fork(this.module, this.args, <ForkOptions>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<LineData> {
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(<any>arg1, arg2, <any>arg3, arg4);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册