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) { |