Chromium Code Reviews

Unified Diff: sdk/lib/_internal/pub/lib/src/command/run.dart

Issue 475093003: Precompile immutable globally-installed pub executables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: sdk/lib/_internal/pub/lib/src/command/run.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/run.dart b/sdk/lib/_internal/pub/lib/src/command/run.dart
index 9881b6de19fa273d0f41797ff47e3ba4a3c4b5ed..d3591e64c59459b3500fbe5184b224375cad30c7 100644
--- a/sdk/lib/_internal/pub/lib/src/command/run.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/run.dart
@@ -6,6 +6,8 @@ library pub.command.run;
import 'dart:async';
+import 'package:path/path.dart' as p;
+
import '../command.dart';
import '../executable.dart';
import '../io.dart';
@@ -34,9 +36,14 @@ class RunCommand extends PubCommand {
var components = split1(executable, ":");
package = components[0];
executable = components[1];
+
+ if (p.split(executable).length > 1) {
+ usageError("Cannot run an executable in a subdirectory of a "
+ "dependency.");
+ }
}
- return runExecutable(this, entrypoint, package, executable, args)
+ return runExecutable(entrypoint, package, executable, args)
.then(flushThenExit);
}
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/global_run.dart ('k') | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine