From 3fa33416970b037fa2f33df008ead65e83c8e984 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 29 May 2023 10:20:00 +0200 Subject: [PATCH] diskLayout(), osInfo() fix parsing issues (mac OS) --- CHANGELOG.md | 7 ++++--- docs/history.html | 11 ++++++++--- docs/index.html | 2 +- lib/osinfo.js | 2 +- lib/util.js | 3 ++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a95408cd..e56f1f70 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.17.14 | 2023-05-29 | `diskLayout()`, `osInfo()` fix parsing issues (mac OS) | | 5.17.13 | 2023-05-24 | `typings` fix typings dynamicData, networkInterfaceDatass | | 5.17.12 | 2023-02-28 | `uuid()` fix unique mac address issue (Android) | | 5.17.11 | 2023-02-27 | `blockDevices()` raid added label, uuid (linux) | @@ -94,10 +95,10 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | 5.17.4 | 2023-01-24 | `networkInterfaces()` sanitizing networkInterfaces device names | | 5.17.3 | 2023-01-10 | `processes()` fix elapsed time parsing (linux) | | 5.17.2 | 2023-01-10 | `utils` fix killing powershell (windows) | -| 5.17.1 | 2023-01-06 | `graphics()` positionX, positionY Ventura fix (max OS) | -| 5.17.0 | 2023-01-06 | `graphics()` added positionX, positionY (max OS) | +| 5.17.1 | 2023-01-06 | `graphics()` positionX, positionY Ventura fix (mac OS) | +| 5.17.0 | 2023-01-06 | `graphics()` added positionX, positionY (mac OS) | | 5.16.9 | 2022-12-27 | updated docs | -| 5.16.8 | 2022-12-22 | `processes()` params truncated fix (max OS) | +| 5.16.8 | 2022-12-22 | `processes()` params truncated fix (mac OS) | | 5.16.7 | 2022-12-22 | `processes()` commandLine missing spaces fix (windows) | | 5.16.6 | 2022-12-12 | `processes()` time format fix (linux) | | 5.16.5 | 2022-12-09 | `inetLatency()` fix for alpine (linux) | diff --git a/docs/history.html b/docs/history.html index e2d5ec80..842938a6 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@

Full version history

+ + 5.17.14 + 2023-05-29 + diskLayout() osInfo()fix parsing issue (mac OS) + 5.17.13 2023-05-24 @@ -120,12 +125,12 @@

Full version history

5.17.1 2023-01-06 - graphics() positionX, positionY Ventura fix (max OS) + graphics() positionX, positionY Ventura fix (mac OS) 5.17.0 2023-01-06 - graphics() added positionX, positionY (max OS) + graphics() added positionX, positionY (mac OS) 5.16.9 @@ -135,7 +140,7 @@

Full version history

5.16.8 2022-12-22 - processes() params truncated fix (max OS) + processes() params truncated fix (mac OS) 5.16.7 diff --git a/docs/index.html b/docs/index.html index ac43588f..a18c35a9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -212,7 +212,7 @@
Downloads last month
-
612
+
613
Dependents
diff --git a/lib/osinfo.js b/lib/osinfo.js index 65207e2b..154ca387 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -289,7 +289,7 @@ function osInfo(callback) { let lines = stdout.toString().split('\n'); result.serial = util.getValue(lines, 'kern.uuid'); result.distro = util.getValue(lines, 'ProductName'); - result.release = util.getValue(lines, 'ProductVersion'); + result.release = (util.getValue(lines, 'ProductVersion', ':', true, true) + ' ' + util.getValue(lines, 'ProductVersionExtra', ':', true, true)).trim(); result.build = util.getValue(lines, 'BuildVersion'); result.logofile = getLogoFile(result.distro); result.codename = 'macOS'; diff --git a/lib/util.js b/lib/util.js index 0c8185f1..d07d6c63 100644 --- a/lib/util.js +++ b/lib/util.js @@ -119,7 +119,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) { trimmed = trimmed || false; lineMatch = lineMatch || false; let result = ''; - lines.forEach((line) => { + lines.some((line) => { let lineLower = line.toLowerCase().replace(/\t/g, ''); if (trimmed) { lineLower = lineLower.trim(); @@ -129,6 +129,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) { if (parts.length >= 2) { parts.shift(); result = parts.join(separator).trim(); + return true; } } });