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

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

Issue 301063002: First stab at "pub run" command. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO. Created 6 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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7
8 import 'package:args/args.dart'; 8 import 'package:args/args.dart';
9 import 'package:http/http.dart' as http; 9 import 'package:http/http.dart' as http;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 27 matching lines...) Expand all
38 if (options['help']) { 38 if (options['help']) {
39 PubCommand.printGlobalUsage(); 39 PubCommand.printGlobalUsage();
40 return; 40 return;
41 } 41 }
42 42
43 if (options['trace']) { 43 if (options['trace']) {
44 log.recordTranscript(); 44 log.recordTranscript();
45 } 45 }
46 46
47 switch (options['verbosity']) { 47 switch (options['verbosity']) {
48 case 'normal': log.showNormal(); break; 48 case 'normal': log.verbosity = log.Verbosity.NORMAL; break;
49 case 'io': log.showIO(); break; 49 case 'io': log.verbosity = log.Verbosity.IO; break;
50 case 'solver': log.showSolver(); break; 50 case 'solver': log.verbosity = log.Verbosity.SOLVER; break;
51 case 'all': log.showAll(); break; 51 case 'all': log.verbosity = log.Verbosity.ALL; break;
52 default: 52 default:
53 // No specific verbosity given, so check for the shortcut. 53 // No specific verbosity given, so check for the shortcut.
54 if (options['verbose']) { 54 if (options['verbose']) {
55 log.showAll(); 55 log.verbosity = log.Verbosity.ALL;
56 } else {
57 log.showNormal();
58 } 56 }
59 break; 57 break;
60 } 58 }
61 59
62 log.fine('Pub ${sdk.version}'); 60 log.fine('Pub ${sdk.version}');
63 61
64 var cacheDir; 62 var cacheDir;
65 if (Platform.environment.containsKey('PUB_CACHE')) { 63 if (Platform.environment.containsKey('PUB_CACHE')) {
66 cacheDir = Platform.environment['PUB_CACHE']; 64 cacheDir = Platform.environment['PUB_CACHE'];
67 } else if (Platform.operatingSystem == 'windows') { 65 } else if (Platform.operatingSystem == 'windows') {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (Platform.operatingSystem != 'windows') return null; 206 if (Platform.operatingSystem != 'windows') return null;
209 207
210 return runProcess('ver', []).then((result) { 208 return runProcess('ver', []).then((result) {
211 if (result.stdout.join('\n').contains('XP')) { 209 if (result.stdout.join('\n').contains('XP')) {
212 log.error('Sorry, but pub is not supported on Windows XP.'); 210 log.error('Sorry, but pub is not supported on Windows XP.');
213 return flushThenExit(exit_codes.USAGE); 211 return flushThenExit(exit_codes.USAGE);
214 } 212 }
215 }); 213 });
216 }); 214 });
217 } 215 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698