-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DotnetCoreInstaller] Fetching download urls from releases.json file #7434
Merged
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9847632
[DotnetCoreInstaller] Fetching download urls from releases.csv file
thesattiraju 92af64a
Fixing tests, adding missing strings
thesattiraju beaeb5b
Fetching json instead
thesattiraju 64c9791
Refactoring
thesattiraju 26d6f16
Fixing UTs
thesattiraju 2fb5f16
Resolving some comments
thesattiraju 090bbd4
Typo
thesattiraju 7759fe0
Fixing linux UT
thesattiraju d63fc54
Added UT for fall back to DLC
thesattiraju 0512392
Adding comments for the public class
thesattiraju cf63520
Updating helptext
thesattiraju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
Tasks/DotNetCoreInstallerV0/Tests/mock_node_modules/releasesfetcher.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ class DotnetCoreInstaller { | |
console.log(tl.loc("InstallingAfresh")); | ||
let osSuffixes = this.detectMachineOS(); | ||
console.log(tl.loc("GettingDownloadUrl", this.packageType, this.version)); | ||
console.log("DotNetCoreReleaseFetcher ", JSON.stringify(DotNetCoreReleaseFetcher)); | ||
let downloadUrls = await DotNetCoreReleaseFetcher.getDownloadUrls(osSuffixes, this.version, this.packageType); | ||
toolPath = await this.downloadAndInstall(downloadUrls); | ||
} else { | ||
|
@@ -68,16 +67,16 @@ class DotnetCoreInstaller { | |
let output: string = result.stdout; | ||
|
||
let index; | ||
if (index = output.indexOf("Primary:")) { | ||
let primary = output.substr(index).split(os.EOL)[0]; | ||
if ((index = output.indexOf("Primary:")) >= 0) { | ||
let primary = output.substr(index + "Primary:".length).split(os.EOL)[0]; | ||
osSuffix.push(primary); | ||
console.log(tl.loc("PrimaryPlatform", primary)); | ||
} | ||
|
||
if (index = output.indexOf("Legacy:")) { | ||
let legacy = output.substr(index).split(os.EOL)[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("PrimaryPlatform", legacy)); | ||
console.log(tl.loc("LegacyPlatform", legacy)); | ||
} | ||
|
||
if (osSuffix.length == 0) { | ||
|
@@ -92,13 +91,10 @@ class DotnetCoreInstaller { | |
let downloaded = false; | ||
let downloadPath = ""; | ||
for (var i = 0; i < downloadUrls.length; i++) { | ||
if (downloaded) { | ||
break; | ||
} | ||
|
||
try { | ||
downloadPath = await toolLib.downloadTool(downloadUrls[i]); | ||
downloaded = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. break here itself instead of having an if condition at the top |
||
break; | ||
} catch (error) { | ||
tl.warning(tl.loc("CouldNotDownload", downloadUrls[i], JSON.stringify(error))); | ||
} | ||
|
@@ -117,7 +113,6 @@ class DotnetCoreInstaller { | |
let cachedDir = await toolLib.cacheDir(extPath, this.cachedToolName, this.version); | ||
console.log(tl.loc("SuccessfullyInstalled", this.packageType, this.version)); | ||
return cachedDir; | ||
|
||
} | ||
|
||
private packageType: string; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text is not up-to the mark. Can you specify the exact strings to look for in the json