Index: sdk/lib/_internal/pub/lib/src/command/global_run.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/command/global_run.dart b/sdk/lib/_internal/pub/lib/src/command/global_run.dart |
index d0f35ba70af58aaaf3b117f71c3343d1fc34ecc5..e9746ccdd2892c05f67eced168514641e751c498 100644 |
--- a/sdk/lib/_internal/pub/lib/src/command/global_run.dart |
+++ b/sdk/lib/_internal/pub/lib/src/command/global_run.dart |
@@ -6,8 +6,9 @@ library pub.command.global_run; |
import 'dart:async'; |
+import 'package:path/path.dart' as p; |
+ |
import '../command.dart'; |
-import '../executable.dart'; |
import '../io.dart'; |
import '../utils.dart'; |
@@ -37,10 +38,11 @@ class GlobalRunCommand extends PubCommand { |
} |
var args = commandOptions.rest.skip(1).toList(); |
+ if (p.split(executable).length > 1) { |
+ usageError('Cannot run an executable in a subdirectory of a global ' |
+ 'package.'); |
+ } |
- return globals.find(package).then((entrypoint) { |
- return runExecutable(this, entrypoint, package, executable, args, |
- isGlobal: true); |
- }).then(flushThenExit); |
+ return globals.runExecutable(package, executable, args).then(flushThenExit); |
} |
} |