From 9a95fd00c8c902583c93b52c929265d8809f603e Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 30 Dec 2024 14:51:00 +0100 Subject: [PATCH] system() adapted model and version (macOS) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/system.js | 11 +++++++---- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4146cbb..37ab3eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.23.25 | 2024-12-30 | `system()` adapted model and version (macOS) | | 5.23.24 | 2024-12-29 | `osInfo()` improved logofile detection | | 5.23.23 | 2024-12-25 | `bluetoothDevices()` added parsing vendor ID (macOS) | | 5.23.22 | 2024-12-25 | `osInfo()` fix manufacturer Apple Silicon (macOS) | diff --git a/docs/history.html b/docs/history.html index 08408d0..711900a 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.23.25 + 2024-12-30 + system() adapted model and version (macOS) + 5.23.24 2024-12-29 diff --git a/docs/index.html b/docs/index.html index 841845b..5306131 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.23.24
+
New Version: 5.23.25
diff --git a/lib/system.js b/lib/system.js index c1e28f2..4c8b000 100644 --- a/lib/system.js +++ b/lib/system.js @@ -215,11 +215,14 @@ function system(callback) { exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) { if (!error) { let lines = stdout.toString().replace(/[<>"]/g, '').split('\n'); - const model = util.splitByNumber(util.getValue(lines, 'model', '=', true)); - const version = util.getValue(lines, 'version', '=', true); + + const model = util.getAppleModel(util.getValue(lines, 'model', '=', true)); + // const modelParts = util.splitByNumber(model); + // const version = util.getValue(lines, 'version', '=', true); result.manufacturer = util.getValue(lines, 'manufacturer', '=', true); - result.model = version ? util.getValue(lines, 'model', '=', true) : model[0]; - result.version = version || model[1]; + result.model = model.key; + result.type = macOsChassisType(model.model); + result.version = model.version; result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true); result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase(); result.sku = util.getValue(lines, 'board-id', '=', true) || util.getValue(lines, 'target-sub-type', '=', true);