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

Unified Diff: sdk/lib/_internal/pub/lib/src/entrypoint.dart

Issue 15213002: Add unit tests for [Entrypoint.packageFiles] in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
Index: sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index 359c77b4823ebb735c72bb9f62374f97f1acc400..363f2b1248570045a6269ac8b013ee0ff92c8a94 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -239,17 +239,20 @@ class Entrypoint {
// List all files that aren't gitignored, including those not checked
// in to Git.
return git.run(["ls-files", "--cached", "--others",
- "--exclude-standard", beneath]).then((files) {
+ "--exclude-standard", beneath],
+ workingDir: root.dir).then((files) {
Bob Nystrom 2013/05/16 18:14:20 The indentation is a bit wonky here. How about: r
nweiz 2013/05/16 18:40:03 Done.
// Git always prints files relative to the project root, but we want
// them relative to the working directory.
return files.map((file) => path.join(root.dir, file));
});
}
- // Skip directories and broken symlinks.
- return listDir(beneath, recursive: true).where(fileExists);
+ return listDir(beneath, recursive: true);
}).then((files) {
return files.where((file) {
+ // Skip directories and broken symlinks.
+ if (!fileExists(file)) return false;
+
var relative = path.relative(file, from: beneath);
if (_BLACKLISTED_FILES.contains(path.basename(relative))) return false;
return !path.split(relative).any(_BLACKLISTED_DIRS.contains);
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/package_files_test.dart » ('j') | sdk/lib/_internal/pub/test/package_files_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698