Skip to content

Commit 061fc6d

Browse files
committed
Do not cache calls to dotnet info
1 parent 0ba29bf commit 061fc6d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/shared/utils/getDotnetInfo.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ import { execChildProcess } from '../../common';
99
import { CoreClrDebugUtil } from '../../coreclrDebug/util';
1010
import { DotnetInfo } from './dotnetInfo';
1111

12-
let _dotnetInfo: DotnetInfo | undefined;
13-
1412
// This function calls `dotnet --info` and returns the result as a DotnetInfo object.
1513
export async function getDotnetInfo(dotNetCliPaths: string[]): Promise<DotnetInfo> {
16-
if (_dotnetInfo !== undefined) {
17-
return _dotnetInfo;
18-
}
19-
2014
const dotnetExecutablePath = getDotNetExecutablePath(dotNetCliPaths);
2115

2216
try {
@@ -62,15 +56,15 @@ export async function getDotnetInfo(dotNetCliPaths: string[]): Promise<DotnetInf
6256
}
6357

6458
if (version !== undefined) {
65-
_dotnetInfo = {
59+
const dotnetInfo: DotnetInfo = {
6660
CliPath: cliPath,
6761
FullInfo: fullInfo,
6862
Version: version,
6963
RuntimeId: runtimeId,
7064
Architecture: architecture,
7165
Runtimes: runtimeVersions,
7266
};
73-
return _dotnetInfo;
67+
return dotnetInfo;
7468
}
7569

7670
throw new Error('Failed to parse dotnet version information');

0 commit comments

Comments
 (0)