Skip to content

Commit

Permalink
diskLayout(), osInfo() fix parsing issues (mac OS)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed May 29, 2023
1 parent 20d5d30 commit 3fa3341
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Expand Up @@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.

| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.17.14 | 2023-05-29 | `diskLayout()`, `osInfo()` fix parsing issues (mac OS) |
| 5.17.13 | 2023-05-24 | `typings` fix typings dynamicData, networkInterfaceDatass |
| 5.17.12 | 2023-02-28 | `uuid()` fix unique mac address issue (Android) |
| 5.17.11 | 2023-02-27 | `blockDevices()` raid added label, uuid (linux) |
Expand All @@ -94,10 +95,10 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| 5.17.4 | 2023-01-24 | `networkInterfaces()` sanitizing networkInterfaces device names |
| 5.17.3 | 2023-01-10 | `processes()` fix elapsed time parsing (linux) |
| 5.17.2 | 2023-01-10 | `utils` fix killing powershell (windows) |
| 5.17.1 | 2023-01-06 | `graphics()` positionX, positionY Ventura fix (max OS) |
| 5.17.0 | 2023-01-06 | `graphics()` added positionX, positionY (max OS) |
| 5.17.1 | 2023-01-06 | `graphics()` positionX, positionY Ventura fix (mac OS) |
| 5.17.0 | 2023-01-06 | `graphics()` added positionX, positionY (mac OS) |
| 5.16.9 | 2022-12-27 | updated docs |
| 5.16.8 | 2022-12-22 | `processes()` params truncated fix (max OS) |
| 5.16.8 | 2022-12-22 | `processes()` params truncated fix (mac OS) |
| 5.16.7 | 2022-12-22 | `processes()` commandLine missing spaces fix (windows) |
| 5.16.6 | 2022-12-12 | `processes()` time format fix (linux) |
| 5.16.5 | 2022-12-09 | `inetLatency()` fix for alpine (linux) |
Expand Down
11 changes: 8 additions & 3 deletions docs/history.html
Expand Up @@ -57,6 +57,11 @@ <h3>Full version history</h3>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.17.14</th>
<td>2023-05-29</td>
<td><span class="code">diskLayout()</span> <span class="code">osInfo()</span>fix parsing issue (mac OS)</td>
</tr>
<tr>
<th scope="row">5.17.13</th>
<td>2023-05-24</td>
Expand Down Expand Up @@ -120,12 +125,12 @@ <h3>Full version history</h3>
<tr>
<th scope="row">5.17.1</th>
<td>2023-01-06</td>
<td><span class="code">graphics()</span> positionX, positionY Ventura fix (max OS)</td>
<td><span class="code">graphics()</span> positionX, positionY Ventura fix (mac OS)</td>
</tr>
<tr>
<th scope="row">5.17.0</th>
<td>2023-01-06</td>
<td><span class="code">graphics()</span> added positionX, positionY (max OS)</td>
<td><span class="code">graphics()</span> added positionX, positionY (mac OS)</td>
</tr>
<tr>
<th scope="row">5.16.9</th>
Expand All @@ -135,7 +140,7 @@ <h3>Full version history</h3>
<tr>
<th scope="row">5.16.8</th>
<td>2022-12-22</td>
<td><span class="code">processes()</span> params truncated fix (max OS)</td>
<td><span class="code">processes()</span> params truncated fix (mac OS)</td>
</tr>
<tr>
<th scope="row">5.16.7</th>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Expand Up @@ -212,7 +212,7 @@
<div class="title">Downloads last month</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">612</div>
<div class="numbers">613</div>
<div class="title">Dependents</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/osinfo.js
Expand Up @@ -289,7 +289,7 @@ function osInfo(callback) {
let lines = stdout.toString().split('\n');
result.serial = util.getValue(lines, 'kern.uuid');
result.distro = util.getValue(lines, 'ProductName');
result.release = util.getValue(lines, 'ProductVersion');
result.release = (util.getValue(lines, 'ProductVersion', ':', true, true) + ' ' + util.getValue(lines, 'ProductVersionExtra', ':', true, true)).trim();
result.build = util.getValue(lines, 'BuildVersion');
result.logofile = getLogoFile(result.distro);
result.codename = 'macOS';
Expand Down
3 changes: 2 additions & 1 deletion lib/util.js
Expand Up @@ -119,7 +119,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
trimmed = trimmed || false;
lineMatch = lineMatch || false;
let result = '';
lines.forEach((line) => {
lines.some((line) => {
let lineLower = line.toLowerCase().replace(/\t/g, '');
if (trimmed) {
lineLower = lineLower.trim();
Expand All @@ -129,6 +129,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
if (parts.length >= 2) {
parts.shift();
result = parts.join(separator).trim();
return true;
}
}
});
Expand Down

0 comments on commit 3fa3341

Please sign in to comment.