-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix issue with multiple versions #13
Conversation
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.
We need more eyes on this PR. It seems ok to me, but we need to make sure :)
__tests__/installer.test.ts
Outdated
@@ -177,7 +177,7 @@ describe('DotnetVersionResolver tests', () => { | |||
const dotnetVersionResolver = new installer.DotnetVersionResolver( | |||
version | |||
); | |||
const versionObject = await dotnetVersionResolver.createDotNetVersion(); |
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.
I personally prefer the previous name of the function because it is more readable. On the other hand if most of people think it is ok to rename it, I am fine with it, this is just nitpicking :)
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.
Changed it just for the sake of consistency as everywhere else in the repo dotnet is spelled in lower case, we can probably change it later with separate PR, if we decide that other version of spelling is better
This PR is outdated and I will close it to avoid any confusion and accident merges. |
Description
Detailed solution description
When dotnet is installed after usage of some other version, install script fails to override dotnet.exe as it appears to be used by a process. Workaround is to pass
--skip-unversioned-files
flag to the install script and avoid overriding this file altogether. However, to ensure better compatibility and to avoid vulnerability issues, LTS runtime is now installed first, providing up-to-date unversioned files (such as CLI) for further usage.Suggested changes
Failed test
It doesn't always fetch install script for some reason, so it can't consistently check if it's up to date. Nothing critical.
Related issue:
actions#387
Check list:
Refactoring description
Refactoring was conducted only for installer.ts module. The most significant changes are in
DotnetCoreInstaller
class:DotnetInstallDir
classDotnetInstallScript
class, which now allows to invoke install-script multiple times and conditionally apply script arguments.Example of
DotnetInstallScript
class usage (just an example code, not how it is actually set here)The script preparation is conducted upon calling the constructor and all platform-specific arguments are inserted by default