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

Unified Diff: utils/pub/validator/lib.dart

Issue 11558022: Fix #7330. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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/tests/pub/pub.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/lib.dart
diff --git a/utils/pub/validator/lib.dart b/utils/pub/validator/lib.dart
index 64f44c6365f5694c8468c8b73d513a0a171a7416..8b9707f7b75fc9a9759e1f72c38f8e8a7af9d476 100644
--- a/utils/pub/validator/lib.dart
+++ b/utils/pub/validator/lib.dart
@@ -21,6 +21,7 @@ class LibValidator extends Validator {
Future validate() {
var libDir = join(entrypoint.root.dir, "lib");
+
return dirExists(libDir).chain((libDirExists) {
if (!libDirExists) {
errors.add('Your package must have a "lib/" directory so users have '
@@ -28,6 +29,13 @@ class LibValidator extends Validator {
return new Future.immediate(null);
}
+ // TODO(rnystrom): listDir() returns real file paths after symlinks are
+ // resolved. This means if libDir contains a symlink, the resulting paths
+ // won't appear to be within it, which confuses relativeTo(). Work around
+ // that here by making sure we have the real path to libDir. Remove this
+ // when #7346 is fixed.
+ libDir = new File(libDir).fullPathSync();
+
nweiz 2012/12/12 19:43:49 We should probably do this in LishCommand._filesTo
Bob Nystrom 2012/12/12 19:49:14 Done. I added it to the other patch since that pat
return listDir(libDir).transform((files) {
files = files.map((file) => relativeTo(file, libDir));
if (files.isEmpty) {
« no previous file with comments | « no previous file | utils/tests/pub/pub.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698