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

Unified Diff: utils/pub/path_source.dart

Issue 12772005: Handle broken symlinks when creating package dirs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 9 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 | « utils/pub/io.dart ('k') | 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/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'.");
}
}
« no previous file with comments | « utils/pub/io.dart ('k') | utils/tests/pub/pub.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698