OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library pub.command.run; | 5 library pub.command.run; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
(...skipping 26 matching lines...) Expand all Loading... |
37 var args = commandOptions.rest.skip(1).toList(); | 37 var args = commandOptions.rest.skip(1).toList(); |
38 | 38 |
39 // A command like "foo:bar" runs the "bar" script from the "foo" package. | 39 // A command like "foo:bar" runs the "bar" script from the "foo" package. |
40 // If there is no colon prefix, default to the root package. | 40 // If there is no colon prefix, default to the root package. |
41 if (executable.contains(":")) { | 41 if (executable.contains(":")) { |
42 var components = split1(executable, ":"); | 42 var components = split1(executable, ":"); |
43 package = components[0]; | 43 package = components[0]; |
44 executable = components[1]; | 44 executable = components[1]; |
45 } | 45 } |
46 | 46 |
47 return runExecutable(entrypoint, package, executable, args) | 47 return runExecutable(this, entrypoint, package, executable, args) |
48 .then(flushThenExit); | 48 .then(flushThenExit); |
49 } | 49 } |
50 } | 50 } |
OLD | NEW |