Skip to content

Commit 7c1435b

Browse files
committed
use withFileTypes in move-caches.js some more
1 parent 3cb31ef commit 7c1435b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/actions/cache-query-compilation/move-caches.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ function* walkCaches(dir) {
2626
}
2727

2828
async function copyDir(src, dest) {
29-
for await (const file of await fs.promises.readdir(src)) {
30-
const srcPath = path.join(src, file);
31-
const destPath = path.join(dest, file);
32-
const stat = await fs.promises.stat(srcPath);
33-
if (stat.isDirectory()) {
29+
for await (const file of await fs.promises.readdir(src, { withFileTypes: true })) {
30+
const srcPath = path.join(src, file.name);
31+
const destPath = path.join(dest, file.name);
32+
if (file.isDirectory()) {
3433
if (!fs.existsSync(destPath)) {
3534
fs.mkdirSync(destPath);
3635
}

0 commit comments

Comments
 (0)