Skip to content

Commit 7a4c96e

Browse files
authored
fix an issue generating libraries named 'packages' (#1243)
1 parent 7a61c60 commit 7a4c96e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## unreleased
2+
* fixed an issue with documenting libraries starting with `packages`
3+
14
## 0.9.7+3
25
* Extended package_config dependency to include stable 1.0.0 api.
36

lib/src/io_utils.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Iterable<String> _doList(String dir, Set<String> listedDirectories,
5151
/// Given a package name, explore the directory and pull out all top level
5252
/// library files in the "lib" directory to document.
5353
Iterable<String> findFilesToDocumentInPackage(String packageDir) sync* {
54+
final String sep = path.separator;
55+
5456
var packageLibDir = path.join(packageDir, 'lib');
5557
var packageLibSrcDir = path.join(packageLibDir, 'src');
5658

@@ -60,8 +62,8 @@ Iterable<String> findFilesToDocumentInPackage(String packageDir) sync* {
6062
for (var lib
6163
in listDir(packageDir, recursive: true, listDir: _packageDirList)) {
6264
if (lib.endsWith('.dart') &&
63-
(!lib.contains('${path.separator}packages') ||
64-
packageDir.contains('${path.separator}packages'))) {
65+
(!lib.contains('${sep}packages${sep}') ||
66+
packageDir.contains('${sep}packages${sep}'))) {
6567
// Only include libraries within the lib dir that are not in lib/src
6668
if (path.isWithin(packageLibDir, lib) &&
6769
!path.isWithin(packageLibSrcDir, lib)) {

0 commit comments

Comments
 (0)