Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: sdk/lib/_internal/pub/lib/src/global_packages.dart

Issue 550643003: Add a --mode flag to pub run and pub global run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/global_packages.dart
diff --git a/sdk/lib/_internal/pub/lib/src/global_packages.dart b/sdk/lib/_internal/pub/lib/src/global_packages.dart
index 6f3da60e58ea6e0c61a438ec5becfae227b293b9..f5a7d6587e7689077815a807d19996a8ba08feeb 100644
--- a/sdk/lib/_internal/pub/lib/src/global_packages.dart
+++ b/sdk/lib/_internal/pub/lib/src/global_packages.dart
@@ -293,14 +293,20 @@ class GlobalPackages {
/// recompiled if the SDK has been upgraded since it was first compiled and
/// then run. Otherwise, it will be run from source.
///
+ /// If [mode] is passed, it's used as the barback mode; it defaults to
+ /// [BarbackMode.RELEASE].
+ ///
/// Returns the exit code from the executable.
Future<int> runExecutable(String package, String executable,
- Iterable<String> args) {
+ Iterable<String> args, {BarbackMode mode}) {
+ if (mode == null) mode = BarbackMode.RELEASE;
+
var binDir = p.join(_directory, package, 'bin');
- if (!fileExists(p.join(binDir, '$executable.dart.snapshot'))) {
+ if (mode != BarbackMode.RELEASE ||
+ !fileExists(p.join(binDir, '$executable.dart.snapshot'))) {
return find(package).then((entrypoint) {
return exe.runExecutable(entrypoint, package, executable, args,
- isGlobal: true);
+ mode: mode, isGlobal: true);
});
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/executable.dart ('k') | sdk/lib/_internal/pub/test/global/run/errors_if_outside_bin_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698