mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
don't decode stderr
This commit is contained in:
@@ -179,12 +179,12 @@ export async function exec(child: cp.ChildProcess, encoding: string = 'utf8'): P
|
||||
new Promise<string>(c => {
|
||||
const buffers: Buffer[] = [];
|
||||
on(child.stdout, 'data', b => buffers.push(b));
|
||||
once(child.stdout, 'close', () => c(decode(Buffer.concat(buffers), encoding)));
|
||||
once(child.stdout, 'close', () => c(iconv.decode(Buffer.concat(buffers), encoding)));
|
||||
}),
|
||||
new Promise<string>(c => {
|
||||
const buffers: Buffer[] = [];
|
||||
on(child.stderr, 'data', b => buffers.push(b));
|
||||
once(child.stderr, 'close', () => c(decode(Buffer.concat(buffers), encoding)));
|
||||
once(child.stderr, 'close', () => c(Buffer.concat(buffers).toString('utf8')));
|
||||
})
|
||||
]);
|
||||
|
||||
@@ -193,10 +193,6 @@ export async function exec(child: cp.ChildProcess, encoding: string = 'utf8'): P
|
||||
return { exitCode, stdout, stderr };
|
||||
}
|
||||
|
||||
function decode(buffer: NodeBuffer, encoding: string): string {
|
||||
return iconv.decode(buffer, encoding);
|
||||
}
|
||||
|
||||
export interface IGitErrorData {
|
||||
error?: Error;
|
||||
message?: string;
|
||||
|
||||
Reference in New Issue
Block a user