Ignore errors when gathering file size
This commit is contained in:
parent
561ddfa28f
commit
c507aa075e
3 changed files with 13 additions and 3 deletions
7
util.js
7
util.js
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue