blockdevices() catch errors adapted for just one line

This commit is contained in:
Sebastian Hildebrandt 2020-11-09 08:27:15 +01:00
parent 53e0e49b77
commit 932f962872
5 changed files with 19 additions and 14 deletions

View File

@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 4.29.2 | 2020-11-09 | `blockdevices()` catch errors adapted for just one line |
| 4.29.2 | 2020-11-09 | `blockdevices()` catch errors |
| 4.29.1 | 2020-11-08 | `cpu()`, `system()` better parsing Raspberry Pi revision codes |
| 4.29.0 | 2020-11-08 | `fsSize()` correct fs type detection macOS (HFS, APFS, NFS) |

View File

@ -30,7 +30,7 @@
[![Sponsoring][sponsor-badge]][sponsor-url]
[![MIT license][license-img]][license-url]
This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 300 versions published, up to 2 mio downloads per month, > 20 mio downloads overall. Thank you to all who contributed to this project!
This is amazing. Started as a small project just for myself, it now has > 10,000 lines of code, > 350 versions published, up to 2 mio downloads per month, > 20 mio downloads overall. Thank you to all who contributed to this project!
## New Version 4.0

View File

@ -83,6 +83,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.29.3</th>
<td>2020-11-09</td>
<td><span class="code">blockdevices()</span> catch error adapted</td>
</tr>
<tr>
<th scope="row">4.29.2</th>
<td>2020-11-09</td>

View File

@ -168,7 +168,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.29.2</span></div>
<div class="version">Current Version: <span id="version">4.29.3</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">
@ -199,7 +199,7 @@
</div>
<div class="row number-section">
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">9,988</div>
<div class="numbers">10,943</div>
<div class="title">Lines of code</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
@ -208,7 +208,7 @@
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">359</div>
<div class="title">Dependends</div>
<div class="title">Dependents</div>
</div>
</div>
<div class="row justify-content-center sectionheader index">

View File

@ -268,8 +268,8 @@ function parseDevices(lines) {
function parseBlk(lines) {
let data = [];
try {
lines.filter(line => line !== '').forEach((line) => {
lines.filter(line => line !== '').forEach((line) => {
try {
line = decodeURIComponent(line.replace(/\\x/g, '%'));
line = line.replace(/\\/g, '\\\\');
let disk = JSON.parse(line);
@ -288,14 +288,13 @@ function parseBlk(lines) {
'protocol': disk.tran,
'group': disk.group,
});
});
data = util.unique(data);
data = util.sortByKey(data, ['type', 'name']);
return data;
} catch (e) {
return [];
}
} catch (e) {
util.noop();
}
});
data = util.unique(data);
data = util.sortByKey(data, ['type', 'name']);
return data;
}
function blkStdoutToObject(stdout) {