Skip to content

Commit

Permalink
don't follow links
Browse files Browse the repository at this point in the history
  • Loading branch information
2ZeroSix committed Feb 3, 2022
1 parent 47bb026 commit f371314
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class Package {
return Ignore.listFiles(
beneath: beneath,
listDir: (dir) {
var contents = Directory(resolve(dir)).listSync(recursive: true);
var contents = Directory(resolve(dir)).listSync(followLinks: false);
if (!recursive) {
contents = contents.where((entity) => entity is! Directory).toList();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/validator/gitignore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GitignoreValidator extends Validator {
final unignoredByGitignore = Ignore.listFiles(
beneath: beneath,
listDir: (dir) {
var contents = Directory(resolve(dir)).listSync();
var contents = Directory(resolve(dir)).listSync(followLinks: false);
return contents.map((entity) =>
p.posix.joinAll(p.split(p.relative(entity.path, from: root))));
},
Expand Down
3 changes: 2 additions & 1 deletion test/package_list_files_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ void main() {
(e) => e.message,
'message',
contains(
'Pub does not support publishing packages with non-resolving symlink:'),
'Pub does not support publishing packages with directory symlinks',
),
),
),
);
Expand Down

0 comments on commit f371314

Please sign in to comment.