-
Notifications
You must be signed in to change notification settings - Fork 266
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
Consider when the user Cancels the SDK Installer on Mac #1993
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
*--------------------------------------------------------------------------------------------*/ | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
import * as os from 'os'; | ||
import { | ||
DotnetInstallationValidated, | ||
DotnetInstallationValidationError, | ||
|
@@ -34,8 +35,16 @@ export class InstallationValidator extends IInstallationValidator { | |
this.assertOrThrowError(failOnErr, fs.existsSync(folder), | ||
`${dotnetValidationFailed} Expected dotnet folder ${dotnetPath} does not exist.`, install, dotnetPath); | ||
|
||
this.assertOrThrowError(failOnErr, fs.readdirSync(folder).length !== 0, | ||
`${dotnetValidationFailed} The dotnet folder is empty "${dotnetPath}"`, install, dotnetPath); | ||
try | ||
{ | ||
this.assertOrThrowError(failOnErr, fs.readdirSync(folder).length !== 0, | ||
`${dotnetValidationFailed} The dotnet folder is empty "${dotnetPath}"`, install, dotnetPath); | ||
} | ||
catch(error : any) // fs.readdirsync throws ENOENT so we need to recall the function | ||
{ | ||
this.assertOrThrowError(failOnErr, false, | ||
`${dotnetValidationFailed} The dotnet file dne "${dotnetPath}"`, install, dotnetPath); | ||
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. dne? 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. does not exist 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. I should be more clear with these messages, good point |
||
} | ||
} | ||
|
||
this.eventStream.post(new DotnetInstallationValidated(install)); | ||
|
@@ -47,7 +56,14 @@ export class InstallationValidator extends IInstallationValidator { | |
this.eventStream.post(new DotnetInstallationValidationError(new Error(message), install, dotnetPath)); | ||
throw new EventBasedError('DotnetInstallationValidationError', message); | ||
} | ||
else if(!passedValidation) | ||
|
||
if(os.platform() === 'darwin') | ||
{ | ||
message = `Did you close the .NET Installer, cancel the installation, or refuse the password prompt? If you want to install the .NET SDK, please try again. If you are facing an error, please report it at https://github.com/dotnet/vscode-dotnet-runtime/issues. | ||
${message}`; | ||
} | ||
|
||
if(!passedValidation && !failOnErr) | ||
{ | ||
this.eventStream?.post(new DotnetInstallationValidationMissed(new Error(message), message)) | ||
} | ||
|
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.
Is this needed?
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.
This is no longer needed, thank you, I will remove this in a upcoming change