From e2c130a490a6d909dc76879328022088d570d57c Mon Sep 17 00:00:00 2001 From: Deepak Sattiraju Date: Fri, 6 Jul 2018 10:15:53 +0530 Subject: [PATCH 1/3] [DotnetCoreInstaller] Appending file name to download path --- Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts | 6 +++--- Tasks/DotNetCoreInstallerV0/task.json | 2 +- Tasks/DotNetCoreInstallerV0/task.loc.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts b/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts index e5c1fd4677a9..2889d945461e 100644 --- a/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts +++ b/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts @@ -90,13 +90,13 @@ class DotnetCoreInstaller { private async downloadAndInstall(downloadUrls: string[]) { let downloaded = false; let downloadPath = ""; - for (var i = 0; i < downloadUrls.length; i++) { + for (const url of downloadUrls) { try { - downloadPath = await toolLib.downloadTool(downloadUrls[i]); + downloadPath = await toolLib.downloadTool(url, url.split('/').pop()); downloaded = true; break; } catch (error) { - tl.warning(tl.loc("CouldNotDownload", downloadUrls[i], JSON.stringify(error))); + tl.warning(tl.loc("CouldNotDownload", url, JSON.stringify(error))); } } diff --git a/Tasks/DotNetCoreInstallerV0/task.json b/Tasks/DotNetCoreInstallerV0/task.json index c565f5fd3130..055de6b5bdcf 100644 --- a/Tasks/DotNetCoreInstallerV0/task.json +++ b/Tasks/DotNetCoreInstallerV0/task.json @@ -13,7 +13,7 @@ "version": { "Major": 0, "Minor": 1, - "Patch": 10 + "Patch": 11 }, "satisfies": [ "DotNetCore" diff --git a/Tasks/DotNetCoreInstallerV0/task.loc.json b/Tasks/DotNetCoreInstallerV0/task.loc.json index 5274eb00a6d1..0b330835c606 100644 --- a/Tasks/DotNetCoreInstallerV0/task.loc.json +++ b/Tasks/DotNetCoreInstallerV0/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 0, "Minor": 1, - "Patch": 10 + "Patch": 11 }, "satisfies": [ "DotNetCore" From 41a73e3100fd715dea71cf297e44562e5c969278 Mon Sep 17 00:00:00 2001 From: Deepak Sattiraju Date: Fri, 6 Jul 2018 10:37:55 +0530 Subject: [PATCH 2/3] Using zip in case of windows --- Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts b/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts index 2889d945461e..359264594b43 100644 --- a/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts +++ b/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts @@ -92,7 +92,7 @@ class DotnetCoreInstaller { let downloadPath = ""; for (const url of downloadUrls) { try { - downloadPath = await toolLib.downloadTool(url, url.split('/').pop()); + downloadPath = await toolLib.downloadTool(url); downloaded = true; break; } catch (error) { @@ -106,7 +106,7 @@ class DotnetCoreInstaller { // extract console.log(tl.loc("ExtractingPackage", downloadPath)); - let extPath: string = downloadPath.endsWith(".zip") ? await toolLib.extractZip(downloadPath) : await toolLib.extractTar(downloadPath); + let extPath: string = tl.osType().match(/^Win/) ? await toolLib.extractZip(downloadPath) : await toolLib.extractTar(downloadPath); // cache tool console.log(tl.loc("CachingTool")); From 4b0ea69e236f75e4779dbcdd538b63f5fccb52ef Mon Sep 17 00:00:00 2001 From: Deepak Sattiraju Date: Fri, 6 Jul 2018 11:17:22 +0530 Subject: [PATCH 3/3] Adding missing braces --- Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts b/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts index 359264594b43..c1570bce39f2 100644 --- a/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts +++ b/Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts @@ -73,7 +73,7 @@ class DotnetCoreInstaller { console.log(tl.loc("PrimaryPlatform", primary)); } - if (index = output.indexOf("Legacy:") >= 0) { + if ((index = output.indexOf("Legacy:")) >= 0) { let legacy = output.substr(index + "Legacy:".length).split(os.EOL)[0]; osSuffix.push(legacy); console.log(tl.loc("LegacyPlatform", legacy));