From 7f2cf7a4ce9cbaac3c99b14a1d1a994f351737bb Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 7 Jun 2023 20:26:41 +0200 Subject: [PATCH] fsSize() improved error handling (linux alpine) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/filesystem.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d315884..d8d96c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.18.2 | 2023-06-08 | `fsSize()` improved error handling (linux alpine) | | 5.18.1 | 2023-06-07 | `networkInterfaces()` cleaned up testVirtualNic | | 5.18.0 | 2023-06-06 | `fsSize()` added optional drive parameter | | 5.17.17 | 2023-06-03 | `osInfo()` improved fqdn (linux) | diff --git a/docs/history.html b/docs/history.html index 90221cb..992e829 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.18.2 + 2023-06-07 + fsSize() improved error handling (alpine linux) + 5.18.1 2023-06-07 diff --git a/docs/index.html b/docs/index.html index 8223b56..ab7c7c9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.18.1
+
New Version: 5.18.2
diff --git a/lib/filesystem.js b/lib/filesystem.js index b84baf9..7aaaf1d 100644 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -158,7 +158,7 @@ function fsSize(drive, callback) { return item.fs.toLowerCase().indexOf(drive.toLowerCase()) >= 0 || item.mount.toLowerCase().indexOf(drive.toLowerCase()) >= 0; }); } - if ((!error || data.length) && stdout.toString().toLowerCase().indexOf('unrecognized option') === -1) { + if ((!error || data.length) && stdout.toString().trim() !== '') { if (callback) { callback(data); }