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

Unified Diff: utils/pub/io.dart

Issue 14187003: Stop manually handling broken symlinks in listDir in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Re-upload Created 7 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 9f9c0a1b1c022dc3dc8cf22dba337c4274e68ede..ebc242dd6c6bdfc669661a1a8f32da6abd4dcc79 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -144,29 +144,19 @@ List<String> listDir(String dir, {bool recursive: false,
log.io("Listing directory $dir.");
- var children = [];
- for (var entity in new Directory(dir).listSync(followLinks: false)) {
- var entityPath = entity.path;
- if (!includeHidden && path.basename(entityPath).startsWith('.')) continue;
-
- // TODO(nweiz): remove this when issue 9832 is fixed.
- if (entity is Link) {
- // We treat broken symlinks as files, in that we don't want to recurse
- // into them.
- entity = dirExists(entityPath)
- ? new Directory(entityPath)
- : new File(entityPath);
+ var children = <String>[];
+ for (var entity in new Directory(dir).listSync()) {
+ if (!includeHidden && path.basename(entity.path).startsWith('.')) {
+ continue;
}
- if (entity is File) {
- contents.add(entityPath);
- } else if (entity is Directory) {
- contents.add(entityPath);
+ contents.add(entity.path);
+ if (entity is Directory) {
// TODO(nweiz): don't manually recurse once issue 4794 is fixed.
// Note that once we remove the manual recursion, we'll need to
// explicitly filter out files in hidden directories.
if (recursive) {
- children.addAll(doList(entityPath, listedDirectories));
+ children.addAll(doList(entity.path, listedDirectories));
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698