Skip to content

Commit f371314

Browse files
committed
don't follow links
1 parent 47bb026 commit f371314

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/src/package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class Package {
245245
return Ignore.listFiles(
246246
beneath: beneath,
247247
listDir: (dir) {
248-
var contents = Directory(resolve(dir)).listSync(recursive: true);
248+
var contents = Directory(resolve(dir)).listSync(followLinks: false);
249249
if (!recursive) {
250250
contents = contents.where((entity) => entity is! Directory).toList();
251251
}

lib/src/validator/gitignore.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class GitignoreValidator extends Validator {
4545
final unignoredByGitignore = Ignore.listFiles(
4646
beneath: beneath,
4747
listDir: (dir) {
48-
var contents = Directory(resolve(dir)).listSync();
48+
var contents = Directory(resolve(dir)).listSync(followLinks: false);
4949
return contents.map((entity) =>
5050
p.posix.joinAll(p.split(p.relative(entity.path, from: root))));
5151
},

test/package_list_files_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ void main() {
118118
(e) => e.message,
119119
'message',
120120
contains(
121-
'Pub does not support publishing packages with non-resolving symlink:'),
121+
'Pub does not support publishing packages with directory symlinks',
122+
),
122123
),
123124
),
124125
);

0 commit comments

Comments
 (0)