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

Side by Side Diff: utils/pub/pub.dart

Issue 12255016: Get rid of old redundant methods in io.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise and update to latest. Created 7 years, 10 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 | « utils/pub/package.dart ('k') | utils/pub/source.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /// The main entrypoint for the pub command line application. 5 /// The main entrypoint for the pub command line application.
6 library pub; 6 library pub;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import '../../pkg/args/lib/args.dart'; 9 import '../../pkg/args/lib/args.dart';
10 import '../../pkg/path/lib/path.dart' as path; 10 import '../../pkg/path/lib/path.dart' as path;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 if (commandFuture == null) return true; 271 if (commandFuture == null) return true;
272 272
273 return commandFuture; 273 return commandFuture;
274 }).whenComplete(() => cache_.deleteTempDir()).catchError((asyncError) { 274 }).whenComplete(() => cache_.deleteTempDir()).catchError((asyncError) {
275 var e = asyncError.error; 275 var e = asyncError.error;
276 if (e is PubspecNotFoundException && e.name == null) { 276 if (e is PubspecNotFoundException && e.name == null) {
277 e = 'Could not find a file named "pubspec.yaml" in the directory ' 277 e = 'Could not find a file named "pubspec.yaml" in the directory '
278 '${path.current}.'; 278 '${path.current}.';
279 } else if (e is PubspecHasNoNameException && e.name == null) { 279 } else if (e is PubspecHasNoNameException && e.name == null) {
280 e = 'pubspec.yaml is missing the required "name" field (e.g. "name: ' 280 e = 'pubspec.yaml is missing the required "name" field (e.g. "name: '
281 '${basename(path.current)}").'; 281 '${path.basename(path.current)}").';
282 } 282 }
283 283
284 handleError(e, asyncError.stackTrace); 284 handleError(e, asyncError.stackTrace);
285 }).then((_) { 285 }).then((_) {
286 // Explicitly exit on success to ensure that any dangling dart:io handles 286 // Explicitly exit on success to ensure that any dangling dart:io handles
287 // don't cause the process to never terminate. 287 // don't cause the process to never terminate.
288 exit(0); 288 exit(0);
289 }); 289 });
290 } 290 }
291 291
(...skipping 24 matching lines...) Expand all
316 if (exception is HttpException || exception is HttpParserException || 316 if (exception is HttpException || exception is HttpParserException ||
317 exception is SocketIOException || exception is PubHttpException) { 317 exception is SocketIOException || exception is PubHttpException) {
318 return exit_codes.UNAVAILABLE; 318 return exit_codes.UNAVAILABLE;
319 } else if (exception is FormatException) { 319 } else if (exception is FormatException) {
320 return exit_codes.DATA; 320 return exit_codes.DATA;
321 } else { 321 } else {
322 return 1; 322 return 1;
323 } 323 }
324 } 324 }
325 } 325 }
OLDNEW
« no previous file with comments | « utils/pub/package.dart ('k') | utils/pub/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698