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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart

Issue 566093003: Create binstubs for executables when activating a package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise! 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_generated/lib/src/command/global_activate.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart b/sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
index c6a2e22a7329a34936015972b886c95e59bca3c9..7954297bdeefd9a5f5a14451eb2f6ce2979ca6ad 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
@@ -14,8 +14,31 @@ class GlobalActivateCommand extends PubCommand {
help: "The source used to find the package.",
allowed: ["git", "hosted", "path"],
defaultsTo: "hosted");
+ commandParser.addFlag(
+ "no-executables",
+ negatable: false,
+ help: "Do not put executables on PATH.");
+ commandParser.addOption(
+ "executable",
+ abbr: "x",
+ help: "Executable(s) to place on PATH.",
+ allowMultiple: true);
+ commandParser.addFlag(
+ "overwrite-executables",
+ negatable: false,
+ help: "Overwrite executables from other packages with the same name.");
}
Future onRun() {
+ var executables;
+ if (commandOptions.wasParsed("executable")) {
+ if (commandOptions.wasParsed("no-executables")) {
+ usageError("Cannot pass both --no-executables and --executable.");
+ }
+ executables = commandOptions["executable"];
+ } else if (commandOptions["no-executables"]) {
+ executables = [];
+ }
+ var overwrite = commandOptions["overwrite-executables"];
var args = commandOptions.rest;
readArg([String error]) {
if (args.isEmpty) usageError(error);
@@ -33,7 +56,10 @@ class GlobalActivateCommand extends PubCommand {
case "git":
var repo = readArg("No Git repository given.");
validateNoExtraArgs();
- return globals.activateGit(repo);
+ return globals.activateGit(
+ repo,
+ executables,
+ overwriteBinStubs: overwrite);
case "hosted":
var package = readArg("No package to activate given.");
var constraint = VersionConstraint.any;
@@ -45,11 +71,18 @@ class GlobalActivateCommand extends PubCommand {
}
}
validateNoExtraArgs();
- return globals.activateHosted(package, constraint);
+ return globals.activateHosted(
+ package,
+ constraint,
+ executables,
+ overwriteBinStubs: overwrite);
case "path":
var path = readArg("No package to activate given.");
validateNoExtraArgs();
- return globals.activatePath(path);
+ return globals.activatePath(
+ path,
+ executables,
+ overwriteBinStubs: overwrite);
}
throw "unreachable";
}

Powered by Google App Engine
This is Rietveld 408576698