Index: sdk/lib/_internal/pub/lib/src/executable.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/executable.dart b/sdk/lib/_internal/pub/lib/src/executable.dart |
index 34482e36b7a77a432703531721df2af88df9d807..2becb86920e12dc18f4914507da7c87b77d5cbef 100644 |
--- a/sdk/lib/_internal/pub/lib/src/executable.dart |
+++ b/sdk/lib/_internal/pub/lib/src/executable.dart |
@@ -21,9 +21,9 @@ import 'utils.dart'; |
/// Runs [executable] from [package] reachable from [entrypoint]. |
/// |
/// The executable string is a relative Dart file path using native path |
-/// separators without a trailing ".dart" extension. It is contained within |
-/// [package], which should either be the entrypoint package or an immediate |
-/// dependency of it. |
+/// separators with or without a trailing ".dart" extension. It is contained |
+/// within [package], which should either be the entrypoint package or an |
+/// immediate dependency of it. |
/// |
/// Arguments from [args] will be passed to the spawned Dart application. |
/// |
@@ -42,6 +42,11 @@ Future<int> runExecutable(Entrypoint entrypoint, String package, |
log.verbosity = log.Verbosity.WARNING; |
} |
+ // Ignore a trailing extension. |
+ if (p.extension(executable) == ".dart") { |
+ executable = p.withoutExtension(executable); |
+ } |
+ |
var localSnapshotPath = p.join(".pub", "bin", package, |
"$executable.dart.snapshot"); |
if (!isGlobal && fileExists(localSnapshotPath) && |