From 344768649969e72d2ba2fcbab235477faa8c7972 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:25:00 +0200 Subject: [PATCH] Git - use close event when detecting git version (#184998) --- extensions/git/src/git.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 2426563c671..a5a9589dcc4 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -73,7 +73,7 @@ function findSpecificGit(path: string, onValidate: (path: string) => boolean): P const child = cp.spawn(path, ['--version']); child.stdout.on('data', (b: Buffer) => buffers.push(b)); child.on('error', cpErrorHandler(e)); - child.on('exit', code => code ? e(new Error('Not found')) : c({ path, version: parseVersion(Buffer.concat(buffers).toString('utf8').trim()) })); + child.on('close', code => code ? e(new Error('Not found')) : c({ path, version: parseVersion(Buffer.concat(buffers).toString('utf8').trim()) })); }); }