From 8fd8915d58da5c34167c9bcfbd9e63a37faa271d Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 29 May 2019 20:35:33 +0200 Subject: [PATCH] memLayout() fix macos mojave --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 4 ++-- lib/memory.js | 7 ++++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 463b31e..824ef7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.7.1 | 2019-05-29 | `memLayout()` fix macos mojave | | 4.7.0 | 2019-05-29 | partial netBSD support | | 4.6.1 | 2019-05-29 | get wmic path - fic windows | | 4.6.0 | 2019-05-27 | added `dockerInfo()` | diff --git a/docs/history.html b/docs/history.html index 9bea258..6d7fb58 100644 --- a/docs/history.html +++ b/docs/history.html @@ -80,6 +80,11 @@ + + 4.7.1 + 2019-05-29 + memLayout() fix macos mojave + 4.7.0 2019-05-29 diff --git a/docs/index.html b/docs/index.html index 6777304..eb1323a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
-
Current Version: 4.7.0
+
Current Version: 4.7.1
@@ -193,7 +193,7 @@
-
8,512
+
8,536
Lines of code
diff --git a/lib/memory.js b/lib/memory.js index 6d9834a..841af22 100644 --- a/lib/memory.js +++ b/lib/memory.js @@ -307,10 +307,15 @@ function memLayout(callback) { exec('system_profiler SPMemoryDataType', function (error, stdout) { if (!error) { let devices = stdout.toString().split(' BANK '); + let hasBank = true; + if (devices.length === 1) { + devices = stdout.toString().split(' DIMM'); + hasBank = false; + } devices.shift(); devices.forEach(function (device) { let lines = device.split('\n'); - const bank = 'BANK ' + lines[0].trim(); + const bank = (hasBank ? 'BANK ' : 'DIMM') + lines[0].trim(); const size = parseInt(util.getValue(lines, ' Size')); if (size) { result.push({