diff --git a/lib/installer.js b/lib/installer.js index 19f608c..7fc9020 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -215,6 +215,7 @@ class DotnetCoreInstaller { if (downloadUrls.length == 0) { throw `Could not construct download URL. Please ensure that specified version ${version} is valid.`; } + core.debug(`Got download urls ${downloadUrls}`); return downloadUrls; }); } @@ -276,6 +277,10 @@ class DotnetCoreInstaller { let legacyUrl = ''; if (!!output && output.length > 0) { let lines = output.split(os.EOL); + // Fallback to \n if initial split doesn't work (not consistent across versions) + if (lines.length === 1) { + lines = output.split('\n'); + } if (!!lines && lines.length > 0) { lines.forEach((line) => { if (!line) { diff --git a/src/installer.ts b/src/installer.ts index 0ae3cf9..b282d60 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -232,6 +232,8 @@ export class DotnetCoreInstaller { throw `Could not construct download URL. Please ensure that specified version ${version} is valid.`; } + core.debug(`Got download urls ${downloadUrls}`); + return downloadUrls; } @@ -307,6 +309,11 @@ export class DotnetCoreInstaller { let legacyUrl: string = ''; if (!!output && output.length > 0) { let lines: string[] = output.split(os.EOL); + + // Fallback to \n if initial split doesn't work (not consistent across versions) + if (lines.length === 1) { + lines = output.split('\n'); + } if (!!lines && lines.length > 0) { lines.forEach((line: string) => { if (!line) {