memLayout() fix macos mojave
This commit is contained in:
+6
-1
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user