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

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

Issue 1165473002: Start pulling pub from its own repo. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review changes Created 5 years, 7 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/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
deleted file mode 100644
index 7fc07a7aa5792794506057705746ac7e8bb946c2..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/pub/lib/src/command/global_run.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub.command.global_run;
-
-import 'dart:async';
-
-import 'package:barback/barback.dart';
-import 'package:path/path.dart' as p;
-
-import '../command.dart';
-import '../io.dart';
-import '../utils.dart';
-
-/// Handles the `global run` pub command.
-class GlobalRunCommand extends PubCommand {
- String get name => "run";
- String get description =>
- "Run an executable from a globally activated package.\n"
- "NOTE: We are currently optimizing this command's startup time.";
- String get invocation => "pub global run <package>:<executable> [args...]";
- bool get allowTrailingOptions => false;
-
- /// The mode for barback transformers.
- BarbackMode get mode => new BarbackMode(argResults["mode"]);
-
- GlobalRunCommand() {
- argParser.addOption("mode", defaultsTo: "release",
- help: 'Mode to run transformers in.');
- }
-
- Future run() async {
- if (argResults.rest.isEmpty) {
- usageException("Must specify an executable to run.");
- }
-
- var package;
- var executable = argResults.rest[0];
- if (executable.contains(":")) {
- var parts = split1(executable, ":");
- package = parts[0];
- executable = parts[1];
- } else {
- // If the package name is omitted, use the same name for both.
- package = executable;
- }
-
- var args = argResults.rest.skip(1).toList();
- if (p.split(executable).length > 1) {
- // TODO(nweiz): Use adjacent strings when the new async/await compiler
- // lands.
- usageException('Cannot run an executable in a subdirectory of a global ' +
- 'package.');
- }
-
- var exitCode = await globals.runExecutable(package, executable, args,
- mode: mode);
- await flushThenExit(exitCode);
- }
-}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/global_list.dart ('k') | sdk/lib/_internal/pub/lib/src/command/lish.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698