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

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

Issue 427853002: Add a hidden --no-package-symlinks flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
« no previous file with comments | « sdk/lib/_internal/pub/bin/pub.dart ('k') | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/command.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command.dart b/sdk/lib/_internal/pub/lib/src/command.dart
index 0b3e985bb2ba83de6dedacc646630903088e1367..d70bf1733ef3ed52ef1c563ae8af384e948be04a 100644
--- a/sdk/lib/_internal/pub/lib/src/command.dart
+++ b/sdk/lib/_internal/pub/lib/src/command.dart
@@ -105,6 +105,10 @@ abstract class PubCommand {
GlobalPackages get globals => _globals;
GlobalPackages _globals;
+ /// The parsed options for the pub executable.
+ ArgResults get globalOptions => _globalOptions;
+ ArgResults _globalOptions;
+
/// The parsed options for this command.
ArgResults get commandOptions => _commandOptions;
ArgResults _commandOptions;
@@ -115,7 +119,10 @@ abstract class PubCommand {
/// is not a package.
Entrypoint get entrypoint {
// Lazy load it.
- if (_entrypoint == null) _entrypoint = new Entrypoint(path.current, _cache);
+ if (_entrypoint == null) {
+ _entrypoint = new Entrypoint(path.current, _cache,
+ packageSymlinks: globalOptions['package-symlinks']);
+ }
return _entrypoint;
}
@@ -181,8 +188,10 @@ abstract class PubCommand {
help: 'Print usage information for this command.');
}
- /// Runs this command using a system cache at [cacheDir] with [options].
- Future run(String cacheDir, ArgResults options) {
+ /// Runs this command using a system cache at [cacheDir] with [globalOptions]
+ /// and [options].
+ Future run(String cacheDir, ArgResults globalOptions, ArgResults options) {
+ _globalOptions = globalOptions;
_commandOptions = options;
_cache = new SystemCache.withSources(cacheDir, isOffline: isOffline);
@@ -305,6 +314,8 @@ ArgParser _initArgParser() {
help: 'Shortcut for "--verbosity=all".');
argParser.addFlag('with-prejudice', hide: !isAprilFools, negatable: false,
help: 'Execute commands with prejudice.');
+ argParser.addFlag('package-symlinks', hide: true, negatable: true,
+ defaultsTo: true);
// Register the commands.
PubCommand.mainCommands.forEach((name, command) {
« no previous file with comments | « sdk/lib/_internal/pub/bin/pub.dart ('k') | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698