mirror of
https://gitea.com/actions/setup-dotnet.git
synced 2024-11-27 12:03:25 +08:00
Inconsistent splitting behavior fix
This commit is contained in:
parent
035f3d68f7
commit
e6ea2e057b
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user