@@ -16,16 +16,12 @@ import '../utils.dart';
16
16
17
17
/// Returns `true` if [path] looks like a Dart entrypoint.
18
18
bool _isDartExecutable (String path) {
19
- if (p.extension (path) == '.dart' ) {
20
- try {
21
- var unit = analyzer.parseDartFile (path, parseFunctionBodies: false );
22
- return isEntrypoint (unit);
23
- } on analyzer.AnalyzerErrorGroup {
24
- return false ;
25
- }
19
+ try {
20
+ var unit = analyzer.parseDartFile (path, parseFunctionBodies: false );
21
+ return isEntrypoint (unit);
22
+ } on analyzer.AnalyzerErrorGroup {
23
+ return false ;
26
24
}
27
-
28
- return false ;
29
25
}
30
26
31
27
/// Handles the `deps` pub command.
@@ -277,10 +273,9 @@ class DepsCommand extends PubCommand {
277
273
/// Lists all Dart files in the `bin` directory of the [package] .
278
274
///
279
275
/// Returns file names without extensions.
280
- List <String > _getExecutablesFor (Package package) => package
281
- .listFiles (beneath: 'bin' , recursive: false )
282
- .where (_isDartExecutable)
283
- .map (p.basenameWithoutExtension);
276
+ List <String > _getExecutablesFor (Package package) => package.executableIds
277
+ .where ((e) => _isDartExecutable (p.absolute (package.dir, e.path)))
278
+ .map ((e) => p.basenameWithoutExtension (e.path));
284
279
285
280
/// Returns formatted string that lists [executables] for the [packageName] .
286
281
/// Examples:
0 commit comments