memLayout() fix macos mojave

This commit is contained in:
Sebastian Hildebrandt
2019-05-29 20:35:33 +02:00
parent 48806718af
commit 8fd8915d58
4 changed files with 14 additions and 3 deletions
+6 -1
View File
@@ -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({