git: isolate ipc env

This commit is contained in:
Joao Moreno
2019-11-20 16:06:55 +01:00
parent af864aed2f
commit f37b9d742c
5 changed files with 22 additions and 12 deletions

View File

@@ -7,7 +7,17 @@ import * as http from 'http';
export class IPCClient {
constructor(private handlerName: string, private ipcHandlePath: string) { }
private ipcHandlePath: string;
constructor(private handlerName: string) {
const ipcHandlePath = process.env['VSCODE_GIT_IPC_HANDLE'];
if (!ipcHandlePath) {
throw new Error('Missing VSCODE_GIT_IPC_HANDLE');
}
this.ipcHandlePath = ipcHandlePath;
}
call(request: any): Promise<any> {
const opts: http.RequestOptions = {