Skip to content

Commit 86d90a4

Browse files
committed
Moved inits of re-usable vars up in search()
1 parent 36669ad commit 86d90a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/bump/bump-utils.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ export function findFileBySuffix({
6161
const foundFiles = []
6262
;(function search(currentDir) {
6363
for (const entry of fs.readdirSync(currentDir)) {
64-
if (entry == 'node_modules' // or dotfolder but disabled
65-
|| (entry.startsWith('.') && !dotFolders && fs.statSync(path.join(currentDir, entry)).isDirectory())
66-
) continue // skip it
6764
const entryPath = path.join(currentDir, entry), stat = fs.statSync(entryPath)
65+
if (entry == 'node_modules'
66+
|| (entry.startsWith('.') && !dotFolders && stat.isDirectory()) // dotfolder but disabled
67+
) continue // skip it
6868
if (stat.isDirectory() && recursive) search(entryPath)
6969
else if (stat.isFile() && entry.endsWith(suffix) // file w/ `suffix`
7070
&& (dotFiles || !entry.startsWith('.')) // not dotfile if disabled

0 commit comments

Comments
 (0)