Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-chew committed Oct 10, 2023
1 parent 8b231a6 commit 221077f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ export async function checkSupportedDotnetVersion(): Promise<string | undefined>
return dotnetExecutable + Messages.Dotnet.IsNotAnExecutableFile;
}
const { stdout } = await execFileAsync(dotnetExecutable, [ ListRuntimesArg ]);
const runtimeVersions = [...stdout.matchAll(DotnetConstants.SupportedRuntimesPattern)]
const runtimeVersions = [ ...stdout.matchAll(DotnetConstants.SupportedRuntimesPattern) ]
.map(match => {
const version = match[1];
const full = match[1];
const major = parseInt(match[2], 10);
return [major, version] as [number, string];
return { full, major };
});
if (runtimeVersions.find(([major, _]) => major >= DotnetConstants.SupportedRuntimesMinVersion) !== undefined) {
if(runtimeVersions.find(({ major }) => major >= DotnetConstants.SupportedRuntimesMinVersion) !== undefined) {
return undefined;
}
const runtimeVersionsStr = runtimeVersions.length === 0
? " no installed versions"
: runtimeVersions.map(([_, version]) => version).join(", ");
? ' no installed versions'
: runtimeVersions.map(({ full }) => full).join(', ');
return dotnetExecutable + Messages.Dotnet.NotASupportedDotnetInstallation + runtimeVersionsStr;
} catch(error: unknown) {
const errorMsg = `Error invoking ${dotnetExecutable} ${ListRuntimesArg}: ${error}`;
Expand Down

0 comments on commit 221077f

Please sign in to comment.