Skip to content

Commit

Permalink
double check for directory symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
2ZeroSix committed Feb 3, 2022
1 parent 4982100 commit db790fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ class Package {
listDir: (dir) {
var contents = Directory(resolve(dir)).listSync(followLinks: false);
if (!recursive) {
contents = contents.where((entity) => entity is! Directory).toList();
contents = contents
.where(
(entity) =>
entity is! Directory &&
!(linkExists(entity.path) && dirExists(entity.path)),
)
.toList();
}
return contents.map((entity) {
final relative = p.relative(entity.path, from: root);
Expand Down

0 comments on commit db790fb

Please sign in to comment.