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

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

Issue 12021008: Use the dart:async Stream API thoroughly in Pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 11 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 | « pkg/http/lib/src/byte_stream.dart ('k') | utils/pub/curl_client.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 library command_lish; 5 library command_lish;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:json'; 9 import 'dart:json';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 }); 85 });
86 } 86 }
87 87
88 Future onRun() { 88 Future onRun() {
89 var files; 89 var files;
90 return _filesToPublish.then((f) { 90 return _filesToPublish.then((f) {
91 files = f; 91 files = f;
92 log.fine('Archiving and publishing ${entrypoint.root}.'); 92 log.fine('Archiving and publishing ${entrypoint.root}.');
93 return createTarGz(files, baseDir: entrypoint.root.dir); 93 return createTarGz(files, baseDir: entrypoint.root.dir);
94 }).then(consumeInputStream).then((packageBytes) { 94 }).then((stream) => stream.toBytes()).then((packageBytes) {
95 // Show the package contents so the user can verify they look OK. 95 // Show the package contents so the user can verify they look OK.
96 var package = entrypoint.root; 96 var package = entrypoint.root;
97 log.message( 97 log.message(
98 'Publishing "${package.name}" ${package.version}:\n' 98 'Publishing "${package.name}" ${package.version}:\n'
99 '${generateTree(files)}'); 99 '${generateTree(files)}');
100 100
101 // Validate the package. 101 // Validate the package.
102 return _validate().then((_) => _publish(packageBytes)); 102 return _validate().then((_) => _publish(packageBytes));
103 }); 103 });
104 } 104 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 var s = warnings.length == 1 ? '' : 's'; 177 var s = warnings.length == 1 ? '' : 's';
178 message = "Package has ${warnings.length} warning$s. Upload anyway"; 178 message = "Package has ${warnings.length} warning$s. Upload anyway";
179 } 179 }
180 180
181 return confirm(message).then((confirmed) { 181 return confirm(message).then((confirmed) {
182 if (!confirmed) throw "Package upload canceled."; 182 if (!confirmed) throw "Package upload canceled.";
183 }); 183 });
184 }); 184 });
185 } 185 }
186 } 186 }
OLDNEW
« no previous file with comments | « pkg/http/lib/src/byte_stream.dart ('k') | utils/pub/curl_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698