@@ -102,9 +102,13 @@ class AnalyzeCommand extends FlutterCommand {
102102 }
103103 }
104104
105+ bool currentDirectory = argResults['current-directory' ] && (argResults.wasParsed ('current-directory' ) || dartFiles.isEmpty);
106+ bool currentPackage = argResults['current-package' ] && (argResults.wasParsed ('current-package' ) || dartFiles.isEmpty);
107+ bool flutterRepo = argResults['flutter-repo' ];
108+
105109 //TODO (pq): revisit package and directory defaults
106110
107- if (argResults[ 'current-directory' ] && ! argResults[ 'flutter-repo' ] ) {
111+ if (currentDirectory && ! flutterRepo ) {
108112 // ./*.dart
109113 Directory currentDirectory = new Directory ('.' );
110114 bool foundOne = false ;
@@ -118,7 +122,7 @@ class AnalyzeCommand extends FlutterCommand {
118122 pubSpecDirectories.add (currentDirectory);
119123 }
120124
121- if (argResults[ 'current-package' ] && ! argResults[ 'flutter-repo' ] ) {
125+ if (currentPackage && ! flutterRepo ) {
122126 // **/.*dart
123127 Directory currentDirectory = new Directory ('.' );
124128 _collectDartFiles (currentDirectory, dartFiles);
@@ -129,7 +133,7 @@ class AnalyzeCommand extends FlutterCommand {
129133 //TODO (pq): extract this regexp from the exclude in options
130134 RegExp stockExampleFiles = new RegExp ('examples/stocks/lib/.*\. dart\$ ' );
131135
132- if (argResults[ 'flutter-repo' ] ) {
136+ if (flutterRepo ) {
133137 for (Directory dir in runner.getRepoPackages ()) {
134138 _collectDartFiles (dir, dartFiles,
135139 exclude: (FileSystemEntity entity) => stockExampleFiles.hasMatch (entity.path));
0 commit comments