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

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: 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
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (commandFuture == null) return true; 264 if (commandFuture == null) return true;
265 265
266 return commandFuture; 266 return commandFuture;
267 }).whenComplete(() => cache_.deleteTempDir()).catchError((asyncError) { 267 }).whenComplete(() => cache_.deleteTempDir()).catchError((asyncError) {
268 var e = asyncError.error; 268 var e = asyncError.error;
269 if (e is PubspecNotFoundException && e.name == null) { 269 if (e is PubspecNotFoundException && e.name == null) {
270 e = 'Could not find a file named "pubspec.yaml" in the directory ' 270 e = 'Could not find a file named "pubspec.yaml" in the directory '
271 '${path.current}.'; 271 '${path.current}.';
272 } else if (e is PubspecHasNoNameException && e.name == null) { 272 } else if (e is PubspecHasNoNameException && e.name == null) {
273 e = 'pubspec.yaml is missing the required "name" field (e.g. "name: ' 273 e = 'pubspec.yaml is missing the required "name" field (e.g. "name: '
274 '${basename(path.current)}").'; 274 '${path.basename(path.current)}").';
275 } 275 }
276 276
277 handleError(e, asyncError.stackTrace); 277 handleError(e, asyncError.stackTrace);
278 }).then((_) { 278 }).then((_) {
279 // Explicitly exit on success to ensure that any dangling dart:io handles 279 // Explicitly exit on success to ensure that any dangling dart:io handles
280 // don't cause the process to never terminate. 280 // don't cause the process to never terminate.
281 exit(0); 281 exit(0);
282 }); 282 });
283 } 283 }
284 284
(...skipping 24 matching lines...) Expand all
309 if (exception is HttpException || exception is HttpParserException || 309 if (exception is HttpException || exception is HttpParserException ||
310 exception is SocketIOException || exception is PubHttpException) { 310 exception is SocketIOException || exception is PubHttpException) {
311 return exit_codes.UNAVAILABLE; 311 return exit_codes.UNAVAILABLE;
312 } else if (exception is FormatException) { 312 } else if (exception is FormatException) {
313 return exit_codes.DATA; 313 return exit_codes.DATA;
314 } else { 314 } else {
315 return 1; 315 return 1;
316 } 316 }
317 } 317 }
318 } 318 }
OLDNEW
« utils/pub/io.dart ('K') | « utils/pub/package.dart ('k') | utils/pub/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698