mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix --debug
...and some style nits.
This commit is contained in:
parent
3f8fdb661f
commit
71c8a96fb9
@ -123,10 +123,11 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
defaultsTo: 'out/ios_sim_Release/');
|
||||
}
|
||||
|
||||
String get usageFooter =>
|
||||
'Run "flutter -h -v" for verbose help output, including less commonly used options.\n'
|
||||
'\n'
|
||||
'${doctor.summaryText}';
|
||||
String get usageFooter {
|
||||
return 'Run "flutter -h -v" for verbose help output, including less commonly used options.\n'
|
||||
'\n'
|
||||
'${doctor.summaryText}';
|
||||
}
|
||||
|
||||
List<BuildConfiguration> get buildConfigurations {
|
||||
if (_buildConfigurations == null)
|
||||
@ -136,21 +137,17 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
List<BuildConfiguration> _buildConfigurations;
|
||||
|
||||
String get enginePath {
|
||||
if (!_enginePathSet) {
|
||||
_enginePath = _findEnginePath(_globalResults);
|
||||
_enginePathSet = true;
|
||||
}
|
||||
assert(ArtifactStore.flutterRoot != null);
|
||||
_enginePath ??= _findEnginePath(_globalResults);
|
||||
return _enginePath;
|
||||
}
|
||||
String _enginePath;
|
||||
bool _enginePathSet = false;
|
||||
|
||||
ArgResults _globalResults;
|
||||
|
||||
String get _defaultFlutterRoot {
|
||||
if (Platform.environment.containsKey(kFlutterRootEnvironmentVariableName))
|
||||
return Platform.environment[kFlutterRootEnvironmentVariableName];
|
||||
|
||||
try {
|
||||
String script = Platform.script.toFilePath();
|
||||
if (path.basename(script) == kSnapshotFileName)
|
||||
@ -170,6 +167,12 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
if (globalResults['verbose'])
|
||||
logger.verbose = true;
|
||||
|
||||
// we must set ArtifactStore.flutterRoot early because other features use it
|
||||
// (e.g. enginePath's initialiser uses it)
|
||||
ArtifactStore.flutterRoot = path.normalize(path.absolute(globalResults['flutter-root']));
|
||||
if (globalResults.wasParsed('package-root'))
|
||||
ArtifactStore.packageRoot = path.normalize(path.absolute(globalResults['package-root']));
|
||||
|
||||
// See if the user specified a specific device.
|
||||
deviceManager.specifiedDeviceId = globalResults['device-id'];
|
||||
|
||||
@ -184,15 +187,10 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
|
||||
if (androidSdk != null) {
|
||||
printTrace('Using Android SDK at ${androidSdk.directory}.');
|
||||
|
||||
if (androidSdk.latestVersion != null)
|
||||
printTrace('${androidSdk.latestVersion}');
|
||||
}
|
||||
|
||||
ArtifactStore.flutterRoot = path.normalize(path.absolute(globalResults['flutter-root']));
|
||||
if (globalResults.wasParsed('package-root'))
|
||||
ArtifactStore.packageRoot = path.normalize(path.absolute(globalResults['package-root']));
|
||||
|
||||
if (globalResults['version']) {
|
||||
printStatus(getVersion(ArtifactStore.flutterRoot));
|
||||
printStatus('');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user