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
dist/post/index.js
vendored
7
dist/post/index.js
vendored
|
|
@ -84199,7 +84199,12 @@ async function getFolderSize (rootItemPath, options = {}) {
|
||||||
async function processItem (itemPath) {
|
async function processItem (itemPath) {
|
||||||
if (options.ignore?.test(itemPath)) return
|
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
|
if (typeof stats !== 'object') return
|
||||||
fileSizes.set(stats.ino, stats.size)
|
fileSizes.set(stats.ino, stats.size)
|
||||||
|
|
||||||
|
|
|
||||||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
7
util.js
7
util.js
|
|
@ -12,7 +12,12 @@ async function getFolderSize (rootItemPath, options = {}) {
|
||||||
async function processItem (itemPath) {
|
async function processItem (itemPath) {
|
||||||
if (options.ignore?.test(itemPath)) return
|
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
|
if (typeof stats !== 'object') return
|
||||||
fileSizes.set(stats.ino, stats.size)
|
fileSizes.set(stats.ino, stats.size)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue