From b4a05aef202ed42cf14b558bb0b994cc784f6ed2 Mon Sep 17 00:00:00 2001 From: ccastrotrejo Date: Tue, 17 Oct 2023 13:30:06 -0700 Subject: [PATCH] Add dotnet executable path in list runtimes command --- src/shared/utils/getDotnetInfo.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/utils/getDotnetInfo.ts b/src/shared/utils/getDotnetInfo.ts index 72bbc2cde..7eadc9a1e 100644 --- a/src/shared/utils/getDotnetInfo.ts +++ b/src/shared/utils/getDotnetInfo.ts @@ -70,7 +70,8 @@ async function parseDotnetInfo(dotnetInfo: string, dotnetExecutablePath: string } const runtimeVersions: { [runtime: string]: RuntimeInfo[] } = {}; - const listRuntimes = await execChildProcess('dotnet --list-runtimes', process.cwd(), process.env); + const command = dotnetExecutablePath ? `"${dotnetExecutablePath}"` : 'dotnet'; + const listRuntimes = await execChildProcess(`${command} --list-runtimes`, process.cwd(), process.env); lines = listRuntimes.split(/\r?\n/); for (const line of lines) { let match: RegExpMatchArray | null;