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

Side by Side Diff: sdk/lib/_internal/pub/bin/pub.dart

Issue 16854005: First pass at build dependency graph for barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 8
9 import 'package:args/args.dart'; 9 import 'package:args/args.dart';
10 import 'package:pathos/path.dart' as path; 10 import 'package:pathos/path.dart' as path;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (options['verbose']) { 66 if (options['verbose']) {
67 log.showAll(); 67 log.showAll();
68 } else { 68 } else {
69 log.showNormal(); 69 log.showNormal();
70 } 70 }
71 break; 71 break;
72 } 72 }
73 73
74 log.fine('Pub ${sdk.version}'); 74 log.fine('Pub ${sdk.version}');
75 75
76 var cacheDir;
77 if (Platform.environment.containsKey('PUB_CACHE')) {
78 cacheDir = Platform.environment['PUB_CACHE'];
79 } else if (Platform.operatingSystem == 'windows') {
80 var appData = Platform.environment['APPDATA'];
81 cacheDir = path.join(appData, 'Pub', 'Cache');
82 } else {
83 cacheDir = '${Platform.environment['HOME']}/.pub-cache';
84 }
85
86 validatePlatform().then((_) { 76 validatePlatform().then((_) {
87 PubCommand.commands[options.command.name].run(cacheDir, options); 77 PubCommand.commands[options.command.name].run(options);
88 }); 78 });
89 } 79 }
90 80
91 ArgParser initArgParser() { 81 ArgParser initArgParser() {
92 var argParser = new ArgParser(); 82 var argParser = new ArgParser();
93 83
94 // Add the global options. 84 // Add the global options.
95 argParser.addFlag('help', abbr: 'h', negatable: false, 85 argParser.addFlag('help', abbr: 'h', negatable: false,
96 help: 'Print this usage information.'); 86 help: 'Print this usage information.');
97 argParser.addFlag('version', negatable: false, 87 argParser.addFlag('version', negatable: false,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 for (var name in names) { 151 for (var name in names) {
162 buffer.write(' ${padRight(name, length)} ' 152 buffer.write(' ${padRight(name, length)} '
163 '${PubCommand.commands[name].description}\n'); 153 '${PubCommand.commands[name].description}\n');
164 } 154 }
165 155
166 buffer.write('\n'); 156 buffer.write('\n');
167 buffer.write( 157 buffer.write(
168 'Use "pub help [command]" for more information about a command.'); 158 'Use "pub help [command]" for more information about a command.');
169 log.message(buffer.toString()); 159 log.message(buffer.toString());
170 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698