Index: utils/pub/path_source.dart |
diff --git a/utils/pub/path_source.dart b/utils/pub/path_source.dart |
index bfa09e7a2129b9c8a0fd7f54f707fe22c1d97718..6cdc0707bbb76add33eaf057f917a809446c3060 100644 |
--- a/utils/pub/path_source.dart |
+++ b/utils/pub/path_source.dart |
@@ -106,14 +106,16 @@ class PathSource extends Source { |
void _validatePath(String name, description) { |
var dir = description["path"]; |
+ if (dirExists(dir)) return; |
+ |
+ // Check this after dirExists() so that symlinks to directories don't get |
+ // confused as files. |
if (fileExists(dir)) { |
throw new FormatException( |
"Path dependency for package '$name' must refer to a " |
"directory, not a file. Was '$dir'."); |
} |
- if (!dirExists(dir)) { |
- throw new FormatException("Could not find package '$name' at '$dir'."); |
- } |
+ throw new FormatException("Could not find package '$name' at '$dir'."); |
} |
} |