This commit is contained in:
Joao Moreno
2018-03-20 10:17:01 +01:00
parent 344e93c617
commit ee25b62029
3 changed files with 43 additions and 25 deletions

View File

@@ -366,14 +366,14 @@ function getGitErrorCode(stderr: string): string | undefined {
export class Git {
private gitPath: string;
readonly path: string;
private env: any;
private _onOutput = new EventEmitter();
get onOutput(): EventEmitter { return this._onOutput; }
constructor(options: IGitOptions) {
this.gitPath = options.gitPath;
this.path = options.gitPath;
this.env = options.env || {};
}
@@ -447,7 +447,7 @@ export class Git {
}
spawn(args: string[], options: SpawnOptions = {}): cp.ChildProcess {
if (!this.gitPath) {
if (!this.path) {
throw new Error('git could not be found in the system.');
}
@@ -469,7 +469,7 @@ export class Git {
this.log(`> git ${args.join(' ')}\n`);
}
return cp.spawn(this.gitPath, args, options);
return cp.spawn(this.path, args, options);
}
private log(output: string): void {