fsSize() catch error (mac OS)

This commit is contained in:
Sebastian Hildebrandt 2020-11-30 23:17:29 +01:00
parent d25883839e
commit f2c7f29ede
4 changed files with 15 additions and 5 deletions

View File

@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 4.30.8 | 2020-11-30 | `fsSize()` catch error (mac OS) |
| 4.30.7 | 2020-11-29 | `cpuTemperature()` rewrite hwmon parsing |
| 4.30.6 | 2020-11-27 | wmic added default windows path (windows) |
| 4.30.5 | 2020-11-26 | adapted security update (prototype pollution prevention) |

View File

@ -83,9 +83,14 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.30.8</th>
<td>2020-11-30</td>
<td><span class="code">fsSize()</span> catch error (mac OS)</td>
</tr>
<tr>
<th scope="row">4.30.7</th>
<td>2020-11-28</td>
<td>2020-11-29</td>
<td><span class="code">cpuTemperature()</span> rewrite hwmon parsing (linux)</td>
</tr>
<tr>

View File

@ -169,7 +169,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.30.7</span></div>
<div class="version">Current Version: <span id="version">4.30.8</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">

View File

@ -84,9 +84,13 @@ function fsSize(callback) {
let cmd = '';
if (_darwin) {
cmd = 'df -kP';
macOsDisks = execSync('diskutil list').toString().split('\n').filter(line => {
return !line.startsWith('/') && line.indexOf(':') > 0
});
try {
macOsDisks = execSync('diskutil list').toString().split('\n').filter(line => {
return !line.startsWith('/') && line.indexOf(':') > 0
});
} catch (e) {
macOsDisks = []
}
}
if (_linux) cmd = 'df -lkPTx squashfs | grep ^/';
if (_freebsd || _openbsd || _netbsd) cmd = 'df -lkPT';