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); |
}); |
} |