From 6d5488ad3e8003ff35948bb895de817e20490e20 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Fri, 7 Apr 2017 12:23:57 -0700 Subject: [PATCH] Minor fixes to `flutter packages`. (#9278) --- .../lib/src/commands/packages.dart | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/packages.dart b/packages/flutter_tools/lib/src/commands/packages.dart index 82c839b98f..953560e52e 100644 --- a/packages/flutter_tools/lib/src/commands/packages.dart +++ b/packages/flutter_tools/lib/src/commands/packages.dart @@ -47,14 +47,15 @@ class PackagesGetCommand extends FlutterCommand { ); } - // TODO: implement description @override - String get description => - (upgrade ? 'Upgrade' : 'Get') + ' packages in a Flutter project.'; + String get description { + return '${ upgrade ? "Upgrade" : "Get" } packages in a Flutter project.'; + } @override - String get invocation => - "${runner.executableName} packages $name []"; + String get invocation { + return '${runner.executableName} packages $name []'; + } @override Future runCommand() async { @@ -62,22 +63,23 @@ class PackagesGetCommand extends FlutterCommand { throwToolExit('Too many arguments.\n$usage'); final String target = findProjectRoot( - argResults.rest.length == 1 ? argResults.rest[0] : null); - if (target == null) + argResults.rest.length == 1 ? argResults.rest[0] : null + ); + if (target == null) { throwToolExit( - 'Expected to find project root starting at ' + - (argResults.rest.length == 1 - ? argResults.rest[0] - : 'current working directory') + - '$usage'); + 'Expected to find project root in ' + '${ argResults.rest.length == 1 ? argResults.rest[0] : "current working directory" }.' + ); + } - // 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( directory: target, upgrade: upgrade, offline: argResults['offline'], - checkLastModified: false + checkLastModified: false, ); } }