diff --git a/CHANGELOG.md b/CHANGELOG.md index d11198c..e498e2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,7 +98,8 @@ Other changes | Version | Date | Comment | | -------------- | -------------- | -------- | -| 3.23.6 | 2017-07-11 | added cpuFlags() to getStaticData(), bug fix `graphics()` (Win) | +| 3.23.7 | 2017-07-11 | bug fix `diskLayout()` | +| 3.23.6 | 2017-07-11 | added `cpuFlags()` to `getStaticData()`, bug fix `graphics()` (Win) | | 3.23.5 | 2017-06-29 | bug fix `inetChecksite()` | | 3.23.4 | 2017-06-24 | bug fix `getDynamicData(), getAllData() - mem` | | 3.23.3 | 2017-06-23 | updated docs | diff --git a/lib/cpu.js b/lib/cpu.js index 7787f91..170d569 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -117,7 +117,7 @@ function getCpu() { }); } if (_linux) { - exec("lscpu", function (error, stdout) { + exec("export LC_ALL=C; lscpu; unset LC_ALL", function (error, stdout) { if (!error) { let lines = stdout.toString().split('\n'); const modelline = getValue(lines, 'model name'); @@ -135,11 +135,11 @@ function getCpu() { result = cpuBrandManufacturer(result); result.vendor = getValue(lines, 'vendor id'); - if (!result.vendor) { result.vendor = getValue(lines, 'anbieterkennung'); } + // if (!result.vendor) { result.vendor = getValue(lines, 'anbieterkennung'); } result.family = getValue(lines, 'cpu family'); - if (!result.family) { result.family = getValue(lines, 'prozessorfamilie'); } + // if (!result.family) { result.family = getValue(lines, 'prozessorfamilie'); } result.model = getValue(lines, 'model:'); - if (!result.model) { result.model = getValue(lines, 'modell:'); } + // if (!result.model) { result.model = getValue(lines, 'modell:'); } result.stepping = getValue(lines, 'stepping'); result.revision = getValue(lines, 'cpu revision'); result.cache.l1d = getValue(lines, 'l1d cache'); diff --git a/lib/filesystem.js b/lib/filesystem.js index 31c54a8..117dd25 100644 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -590,14 +590,19 @@ function diskLayout(callback) { let result = []; if (_linux) { - exec("lshw -class disk", function (error, stdout) { + exec("export LC_ALL=C; lshw -class disk; unset LC_ALL", function (error, stdout) { if (!error) { let devices = stdout.toString().split('*-'); devices.shift(); devices.forEach(function (device) { let lines = device.split('\n'); + let mediumType = ''; const logical = getValue(lines, 'logical name', ':', true).trim().replace(/\/dev\//g, ''); - const mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational').toString().split('\n')[0]; + try { + mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational').toString().split('\n')[0]; + } catch (e) { + } + const size = getValue(lines, 'size', ':', true).trim(); if (size && lines.length > 0 && lines[0].trim() === 'disk') { result.push({ @@ -619,7 +624,9 @@ function diskLayout(callback) { } }); } - if (callback) { callback(result) } + if (callback) { + callback(result) + } resolve(result); }); } @@ -659,7 +666,9 @@ function diskLayout(callback) { } }); } - if (callback) { callback(result) } + if (callback) { + callback(result) + } resolve(result); }); } @@ -691,7 +700,9 @@ function diskLayout(callback) { } }); } - if (callback) { callback(result) } + if (callback) { + callback(result) + } resolve(result); }); }