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

View File

@ -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()` |

View File

@ -80,6 +80,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.7.1</th>
<td>2019-05-29</td>
<td><span class="code">memLayout()</span> fix macos mojave</td>
</tr>
<tr>
<th scope="row">4.7.0</th>
<td>2019-05-29</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.7.0</span></div>
<div class="version">Current Version: <span id="version">4.7.1</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">
@ -193,7 +193,7 @@
</div>
<div class="row number-section">
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">8,512</div>
<div class="numbers">8,536</div>
<div class="title">Lines of code</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">

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({