From aab598c1b14e0dea36529352f5efeded622347ce Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 15 Sep 2021 15:19:54 +0200 Subject: [PATCH] diskLayout() fix size (macOS) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/filesystem.js | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8729c31..8222d11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.9.1 | 2021-09-15 | `diskLayout()` fix size (macOS) | | 5.9.0 | 2021-09-15 | `graphics()` new XML parser, added properties (macOS) | | 5.8.9 | 2021-09-13 | `battery()` fix linux | | 5.8.8 | 2021-09-11 | `wifiConnections()`, `wifiInterfaces()`, `wifiNetworks()` fix windows | diff --git a/docs/history.html b/docs/history.html index cd73882..9fdb140 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,6 +56,11 @@ + + 5.9.1 + 2021-09-15 + disklayout() fix size (macOS) + 5.9.0 2021-09-15 diff --git a/docs/index.html b/docs/index.html index 8e3ed67..5c047ea 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.9.0
+
New Version: 5.9.1
diff --git a/lib/filesystem.js b/lib/filesystem.js index 276ae77..bb772db 100755 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -989,7 +989,7 @@ function diskLayout(callback) { if (sizeStr) { let sizeValue = 0; if (sizeStr.indexOf('(') >= 0) { - sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, '').replace(/,/g, '').replace(/ /g, '')); + sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, '').replace(/,/g, '').replace(/\s/g, '')); } if (!sizeValue) { sizeValue = parseInt(sizeStr); @@ -1037,7 +1037,7 @@ function diskLayout(callback) { if (sizeStr) { let sizeValue = 0; if (sizeStr.indexOf('(') >= 0) { - sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, '').replace(/,/g, '').replace(/ /g, '')); + sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, '').replace(/,/g, '').replace(/\s/g, '')); } if (!sizeValue) { sizeValue = parseInt(sizeStr); @@ -1082,7 +1082,7 @@ function diskLayout(callback) { if (sizeStr) { let sizeValue = 0; if (sizeStr.indexOf('(') >= 0) { - sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, '').replace(/,/g, '').replace(/ /g, '')); + sizeValue = parseInt(sizeStr.match(/\(([^)]+)\)/)[1].replace(/\./g, '').replace(/,/g, '').replace(/\s/g, '')); } if (!sizeValue) { sizeValue = parseInt(sizeStr);