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

Unified Diff: utils/pub/command_lish.dart

Issue 12079112: Make a bunch of stuff in pub synchronous. (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 | « no previous file | utils/pub/command_uploader.dart » ('j') | utils/pub/entrypoint.dart » ('J')
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 81d896a956ec32da939736b6c99685efebe33688..10a06840c30c646af279a2163f74be92f15f7685 100644
--- a/utils/pub/command_lish.dart
+++ b/utils/pub/command_lish.dart
@@ -116,11 +116,8 @@ class LishCommand extends PubCommand {
Future<List<String>> get _filesToPublish {
var rootDir = entrypoint.root.dir;
- return Future.wait([
- dirExists(join(rootDir, '.git')),
- git.isInstalled
- ]).then((results) {
- if (results[0] && results[1]) {
+ return git.isInstalled.then((results) {
nweiz 2013/02/01 02:05:55 "results" -> "gitInstalled" It's worrisome that t
Bob Nystrom 2013/02/01 23:17:21 It did. :( pub_lish_test is flaky so you don't see
+ if (dirExists(join(rootDir, '.git')) && gitInstalled) {
// List all files that aren't gitignored, including those not checked
// in to Git.
return git.run(["ls-files", "--cached", "--others",
@@ -129,17 +126,15 @@ class LishCommand extends PubCommand {
return listDir(rootDir, recursive: true).then((entries) {
return Future.wait(entries.map((entry) {
- return fileExists(entry).then((isFile) {
// Skip directories.
- if (!isFile) return null;
-
- // TODO(rnystrom): Making these relative will break archive
- // creation if the cwd is ever *not* the package root directory.
- // Should instead only make these relative right before generating
- // the tree display (which is what really needs them to be).
- // Make it relative to the package root.
- return relativeTo(entry, rootDir);
- });
+ if (!fileExists(entry)) return null;
+
+ // TODO(rnystrom): Making these relative will break archive
+ // creation if the cwd is ever *not* the package root directory.
+ // Should instead only make these relative right before generating
+ // the tree display (which is what really needs them to be).
+ // Make it relative to the package root.
+ return relativeTo(entry, rootDir);
}));
});
}).then((files) => files.where((file) {
« no previous file with comments | « no previous file | utils/pub/command_uploader.dart » ('j') | utils/pub/entrypoint.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698