@lvce-editor/file-system-process 5.17.0 → 5.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1725,13 +1725,14 @@ const getFolderSizeInternal = async path => {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
let total = 0;
|
|
1727
1727
|
try {
|
|
1728
|
-
const stats = await fs.
|
|
1729
|
-
|
|
1730
|
-
if (stats.isDirectory() && !stats.isSymbolicLink()) {
|
|
1728
|
+
const stats = await fs.lstat(path);
|
|
1729
|
+
if (stats.isDirectory()) {
|
|
1731
1730
|
const dirents = await fs.readdir(path);
|
|
1732
1731
|
for (const dirent of dirents) {
|
|
1733
1732
|
total += await getFolderSizeInternal(join(path, dirent));
|
|
1734
1733
|
}
|
|
1734
|
+
} else {
|
|
1735
|
+
total += stats.size;
|
|
1735
1736
|
}
|
|
1736
1737
|
} catch {
|
|
1737
1738
|
return 0;
|