-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Currently the invocation of flutter pub get accepts a target directory
flutter/packages/flutter_tools/lib/src/commands/packages.dart
Lines 78 to 81 in 9cfac48
| @override | |
| String get invocation { | |
| return '${runner!.executableName} pub $name [<target directory>]'; | |
| } |
But in the constructor it requires the command to have a pubspec.yml in the same directory it ran
| requiresPubspecYaml(); |
If not pubspec.yml was found in the current directory (even though there is a valid pubspec in the target) the command fails here
| throw ToolExit(userMessages.flutterNoPubspec); |
Proposed fixed is to delete the required requiresPubspecYaml function from the command constructor and have a helper function on the runCommand method to check for the pubspec on the target directory if one is provided or in the current working directory and its parent folders if not
Metadata
Metadata
Assignees
Labels
toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.