Skip to content

Commit 8bc6c95

Browse files
committed
Cleaner
1 parent aa12320 commit 8bc6c95

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/build-config.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,17 @@ const saveBuild = async ({
5454
);
5555
};
5656

57-
const getPaths = async pattern =>
58-
(await Array.fromAsync(fs.glob(pattern, { withFileTypes: true })))
59-
.flatMap(dirent =>
60-
dirent.isDirectory()
61-
? []
62-
: npath.relative('.', npath.join(dirent.parentPath, dirent.name))
63-
)
64-
.sort();
57+
const getPaths = async pattern => {
58+
const paths = [];
59+
for await (const dirent of fs.glob(pattern, { withFileTypes: true })) {
60+
if (!dirent.isDirectory()) {
61+
paths.push(
62+
npath.relative('.', npath.join(dirent.parentPath, dirent.name))
63+
);
64+
}
65+
}
66+
return paths.sort();
67+
};
6568

6669
const saveBuilds = async ({ env, manifest, onError, onResult }) =>
6770
await Promise.all(

0 commit comments

Comments
 (0)