Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew committed Mar 28, 2015
1 parent d8f2f5c commit 4deb1c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions lib/grinder.dart
Expand Up @@ -56,10 +56,13 @@ void task(String name, [Function taskFunction, List<String> depends = const []])
/// the command-line [args] either by running tasks or responding to
/// recognized options such as --help.
///
/// If [verifyProjectRoot] is true, grinder will verify that the script is being
/// run from a project root.
///
/// If a task fails, throw a [GrinderException] and runs no further tasks.
Future grind(List<String> args, {bool verifyLocation: true}) => new Future(() {
Future grind(List<String> args, {bool verifyProjectRoot: true}) => new Future(() {
discoverTasks(grinder, currentMirrorSystem().isolate.rootLibrary);
return handleArgs(args, verifyLocation: verifyLocation);
return handleArgs(args, verifyProjectRoot: verifyProjectRoot);
});

/**
Expand All @@ -68,8 +71,8 @@ Future grind(List<String> args, {bool verifyLocation: true}) => new Future(() {
* throw a [GrinderException].
*/
@Deprecated('Use `grind` instead.')
Future startGrinder(List<String> args, {bool verifyLocation: true}) {
return handleArgs(args, verifyLocation: verifyLocation);
Future startGrinder(List<String> args, {bool verifyProjectRoot: true}) {
return handleArgs(args, verifyProjectRoot: verifyProjectRoot);
}

// Zone variables.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/cli.dart
Expand Up @@ -19,7 +19,7 @@ const String APP_VERSION = '0.6.6+3';
List<String> grinderArgs() => _args;
List<String> _args;

Future handleArgs(List<String> args, {bool verifyLocation: true}) {
Future handleArgs(List<String> args, {bool verifyProjectRoot: true}) {
_args = args == null ? [] : args;

ArgParser parser = createArgsParser();
Expand All @@ -44,7 +44,7 @@ Future handleArgs(List<String> args, {bool verifyLocation: true}) {
} else if (results['deps']) {
printDeps(grinder);
} else {
if (verifyLocation) {
if (verifyProjectRoot) {
// Verify that we're running from the project root.
if (!getFile('pubspec.yaml').existsSync()) {
fail('This script must be run from the project root.');
Expand Down

0 comments on commit 4deb1c7

Please sign in to comment.