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

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: Code review changes. 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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/package_files_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..86327531fc5acb6b4d67c1685718066bd4d58247 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -238,18 +238,21 @@ class Entrypoint {
if (dirExists(path.join(root.dir, '.git')) && gitInstalled) {
// 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) {
+ return git.run(
+ ["ls-files", "--cached", "--others", "--exclude-standard", beneath],
+ workingDir: root.dir).then((files) {
// 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698