-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Flutter doctor detect IntelliJ on Mac #6262
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
Conversation
| /// Return the absolute path of the user's home directory | ||
| String get homeDirPath { | ||
| if (_homeDirPath == null) { | ||
| _homeDirPath = Platform.environment['HOME'] ?? Platform.environment['USERPROFILE']; |
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 think this should be os specific; in windows we'd use USERPROFILE, and on posix HOME.
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.
Perhaps use a ternary expression against the os, or add this as a method in the OperatingSystemUtils class?
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.
Fair enough. Changed to check Platform.isWindows.
|
|
||
| class IntellijValidator extends DoctorValidator { | ||
| IntellijValidator(String title, {this.version, this.pluginsPath}) : super(title); | ||
| abstract class IntellijValidator extends DoctorValidator { |
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.
nit: I would capitalize this IntelliJValidator -
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.
Done.
| } | ||
| } | ||
|
|
||
| class IntellijValidatorOnLinux extends IntellijValidator { |
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.
perhaps IntelliJLinuxValidator?
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.
Done.
| // ignored | ||
| } | ||
| if (plist != null) { | ||
| int index = plist.indexOf('CFBundleShortVersionString'); |
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 could move inside the try-catch - you could avoid the plist != null check.
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.
Good suggestion. Done.
|
lgtm w/ a few comments - |
A continuation of #6227 so that
flutter doctorcan detect IntelliJ product installations and ensure that the needed plugins are installed on Mac.Platform.environment['HOME']accesses to singlehomeDirPathfunctionFixes #5875 and fixes flutter/flutter-intellij#229.
@Hixie