Skip to content

Commit 3cb31ef

Browse files
erik-kroghaibaars
andauthored
use withFileTypes in move-caches.js
Co-authored-by: Arthur Baars <[email protected]>
1 parent 915d680 commit 3cb31ef

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ const path = require("path");
1313
const COMBINED_CACHE_DIR = process.argv[2];
1414

1515
function* walkCaches(dir) {
16-
const files = fs.readdirSync(dir);
16+
const files = fs.readdirSync(dir, { withFileTypes: true });
1717
for (const file of files) {
18-
const filePath = path.join(dir, file);
19-
if (!fs.existsSync(filePath)) {
20-
continue;
21-
}
22-
const stat = fs.statSync(filePath);
23-
if (stat.isDirectory()) {
18+
if (file.isDirectory()) {
19+
const filePath = path.join(dir, file.name);
2420
yield* walkCaches(filePath);
25-
if (file === ".cache") {
21+
if (file.name === ".cache") {
2622
yield filePath;
2723
}
2824
}

0 commit comments

Comments
 (0)