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

Unified Diff: utils/pub/command_lish.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/command_install.dart ('k') | utils/pub/command_update.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/command_lish.dart
diff --git a/utils/pub/command_lish.dart b/utils/pub/command_lish.dart
index 5afe32ff149a5ae6d4757f83c41ec34d9adfd91a..01136fdaaf2a8507b98b4de25050e1cdae363bbf 100644
--- a/utils/pub/command_lish.dart
+++ b/utils/pub/command_lish.dart
@@ -63,12 +63,12 @@ class LishCommand extends PubCommand {
request.files.add(new http.MultipartFile.fromBytes(
'file', packageBytes, filename: 'package.tar.gz'));
return client.send(request);
- }).chain(http.Response.fromStream).transform((response) {
+ }).chain(http.Response.fromStream).then((response) {
var location = response.headers['location'];
if (location == null) throw new PubHttpException(response);
return location;
- }).chain((location) => client.get(location))
- .transform(handleJsonSuccess);
+ }).then((location) => client.get(location))
+ .then(handleJsonSuccess);
}).transformException((e) {
if (e is! PubHttpException) throw e;
var url = e.response.request.url;
@@ -126,8 +126,8 @@ class LishCommand extends PubCommand {
}
return listDir(rootDir, recursive: true).chain((entries) {
- return Futures.wait(entries.map((entry) {
- return fileExists(entry).transform((isFile) {
+ return Futures.wait(entries.mappedBy((entry) {
+ return fileExists(entry).then((isFile) {
// Skip directories.
if (!isFile) return null;
@@ -140,13 +140,13 @@ class LishCommand extends PubCommand {
});
}));
});
- }).transform((files) => files.filter((file) {
+ }).then((files) => files.where((file) {
if (file == null || _BLACKLISTED_FILES.contains(basename(file))) {
return false;
}
return !splitPath(file).some(_BLACKLISTED_DIRECTORIES.contains);
- }));
+ }).toList());
}
/// Returns the value associated with [key] in [map]. Throws a user-friendly
@@ -176,7 +176,7 @@ class LishCommand extends PubCommand {
message = "Package has ${warnings.length} warning$s. Upload anyway";
}
- return confirm(message).transform((confirmed) {
+ return confirm(message).then((confirmed) {
if (!confirmed) throw "Package upload canceled.";
});
});
« no previous file with comments | « utils/pub/command_install.dart ('k') | utils/pub/command_update.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698