Skip to content

Commit 51f7e27

Browse files
committed
+chore: Bugfix with paths
1 parent 2dc34ca commit 51f7e27

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

lib/src/path_explorer.dart

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,12 @@ class PathExplorer {
7373
final s = recurse(path, () => temp!);
7474
temp = DirPathExplorerFinding._(
7575
path: path,
76-
files:
77-
s
78-
.where((e) => e is FilePathExplorerFinding)
79-
.cast<FilePathExplorerFinding>(),
80-
dirs:
81-
s
82-
.where((e) => e is DirPathExplorerFinding)
83-
.cast<DirPathExplorerFinding>(),
76+
files: s
77+
.where((e) => e is FilePathExplorerFinding)
78+
.cast<FilePathExplorerFinding>(),
79+
dirs: s
80+
.where((e) => e is DirPathExplorerFinding)
81+
.cast<DirPathExplorerFinding>(),
8482
parentDir: parentDir,
8583
);
8684
yield temp;
@@ -102,9 +100,7 @@ class PathExplorer {
102100
}
103101

104102
Stream<FileData> readFiles(bool Function(FilePathExplorerFinding) filter) {
105-
return exploreFiles()
106-
.where(filter)
107-
.asyncMap(
103+
return exploreFiles().where(filter).asyncMap(
108104
(a) async => File(a.path).readAsBytes().then((b) => FileData(a, b)),
109105
);
110106
}
@@ -138,14 +134,12 @@ class PathExplorer {
138134

139135
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
140136

141-
typedef TPathExplorerFindings =
142-
Future<
143-
({
144-
Set<DirPathExplorerFinding> rootDirPathFindings,
145-
Set<DirPathExplorerFinding> dirPathFindings,
146-
Set<FilePathExplorerFinding> filePathFindings,
147-
})
148-
>;
137+
typedef TPathExplorerFindings = Future<
138+
({
139+
Set<DirPathExplorerFinding> rootDirPathFindings,
140+
Set<DirPathExplorerFinding> dirPathFindings,
141+
Set<FilePathExplorerFinding> filePathFindings,
142+
})>;
149143

150144
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
151145

@@ -266,8 +260,7 @@ sealed class PathExplorerFinding {
266260

267261
/// Lists all contents of the given [dirPath].
268262
Stream<String> _normalizedDirContent(String dirPath) async* {
269-
final dirPathUri = Uri.parse(dirPath);
270-
final dir = Directory.fromUri(dirPathUri);
263+
final dir = Directory(dirPath);
271264
yield* dir.list(recursive: false).map((e) => p.normalize(e.path));
272265
}
273266

pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212

1313
name: df_gen_core
1414
description: A package that provides core utilities for practical code generation.
15-
version: 0.6.4
15+
version: 0.6.5
1616
homepage: https://dev-cetera.com/
1717
repository: https://github.com/robmllze/df_gen_core
18+
funding:
19+
- https://www.buymeacoffee.com/dev_cetera
1820

1921
## -----------------------------------------------------------------------------
2022

@@ -30,7 +32,6 @@ dependencies:
3032
df_safer_dart: ^0.10.0
3133
df_string: ^0.2.4
3234
df_type: ^0.10.3
33-
3435
analyzer: ^6.11.0
3536
args: ^2.6.0
3637
collection: ^1.19.1

0 commit comments

Comments
 (0)