Skip to content

Commit 2d7338a

Browse files
author
Lifeng Lu
committed
Fix the regular expression to read RID value.
The dotnet --info may have a single or double space character at the beginning of the RID information line. The current regular expression fails in one of them. It matches how Version/Architecture is extracted.
1 parent d090224 commit 2d7338a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shared/utils/getDotnetInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async function parseDotnetInfo(dotnetInfo: string, dotnetExecutablePath: string
6262
let match: RegExpMatchArray | null;
6363
if ((match = /^\s*Version:\s*([^\s].*)$/.exec(line))) {
6464
version = match[1];
65-
} else if ((match = /^ RID:\s*([\w\-.]+)$/.exec(line))) {
65+
} else if ((match = /^\s*RID:\s*([\w\-.]+)$/.exec(line))) {
6666
runtimeId = match[1];
6767
} else if ((match = /^\s*Architecture:\s*(.*)/.exec(line))) {
6868
architecture = match[1];

0 commit comments

Comments
 (0)