Commit 6d5488ad authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Minor fixes to `flutter packages`. (#9278)

parent ecc590f9
...@@ -47,14 +47,15 @@ class PackagesGetCommand extends FlutterCommand { ...@@ -47,14 +47,15 @@ class PackagesGetCommand extends FlutterCommand {
); );
} }
// TODO: implement description
@override @override
String get description => String get description {
(upgrade ? 'Upgrade' : 'Get') + ' packages in a Flutter project.'; return '${ upgrade ? "Upgrade" : "Get" } packages in a Flutter project.';
}
@override @override
String get invocation => String get invocation {
"${runner.executableName} packages $name [<target directory>]"; return '${runner.executableName} packages $name [<target directory>]';
}
@override @override
Future<Null> runCommand() async { Future<Null> runCommand() async {
...@@ -62,22 +63,23 @@ class PackagesGetCommand extends FlutterCommand { ...@@ -62,22 +63,23 @@ class PackagesGetCommand extends FlutterCommand {
throwToolExit('Too many arguments.\n$usage'); throwToolExit('Too many arguments.\n$usage');
final String target = findProjectRoot( final String target = findProjectRoot(
argResults.rest.length == 1 ? argResults.rest[0] : null); argResults.rest.length == 1 ? argResults.rest[0] : null
if (target == null) );
if (target == null) {
throwToolExit( throwToolExit(
'Expected to find project root starting at ' + 'Expected to find project root in '
(argResults.rest.length == 1 '${ argResults.rest.length == 1 ? argResults.rest[0] : "current working directory" }.'
? argResults.rest[0] );
: 'current working directory') + }
'$usage');
// TODO: If the user is using a local build, we should use the packages from their build instead of the cache. // TODO(ianh): If the user is using a local build, we should use the
// packages from their build instead of the cache.
await pubGet( await pubGet(
directory: target, directory: target,
upgrade: upgrade, upgrade: upgrade,
offline: argResults['offline'], offline: argResults['offline'],
checkLastModified: false checkLastModified: false,
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment