Ignore errors when gathering file size

This commit is contained in:
Alex Rodionov 2023-11-26 13:07:54 -08:00
parent 561ddfa28f
commit c507aa075e
3 changed files with 13 additions and 3 deletions

7
dist/post/index.js vendored
View file

@ -84199,7 +84199,12 @@ async function getFolderSize (rootItemPath, options = {}) {
async function processItem (itemPath) {
if (options.ignore?.test(itemPath)) return
const stats = fs.lstatSync(itemPath, { bigint: true })
try {
const stats = fs.lstatSync(itemPath, { bigint: true })
} catch (error) {
return
}
if (typeof stats !== 'object') return
fileSizes.set(stats.ino, stats.size)

File diff suppressed because one or more lines are too long

View file

@ -12,7 +12,12 @@ async function getFolderSize (rootItemPath, options = {}) {
async function processItem (itemPath) {
if (options.ignore?.test(itemPath)) return
const stats = fs.lstatSync(itemPath, { bigint: true })
try {
const stats = fs.lstatSync(itemPath, { bigint: true })
} catch (error) {
return
}
if (typeof stats !== 'object') return
fileSizes.set(stats.ino, stats.size)