mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Merge pull request #286524 from microsoft/tyriar/286138
Simplify wsl profile detection regex
This commit is contained in:
@@ -359,8 +359,7 @@ async function getWslProfiles(wslPath: string, defaultProfileName: string | unde
|
||||
if (!distroOutput) {
|
||||
return [];
|
||||
}
|
||||
const regex = new RegExp(/[\r?\n]/);
|
||||
const distroNames = distroOutput.split(regex).filter(t => t.trim().length > 0 && t !== '');
|
||||
const distroNames = distroOutput.split(/\r?\n/).filter(t => t.trim().length > 0);
|
||||
for (const distroName of distroNames) {
|
||||
// Skip empty lines
|
||||
if (distroName === '') {
|
||||
|
||||
Reference in New Issue
Block a user