bugfix console.logs

This commit is contained in:
Sebastian Hildebrandt 2019-01-07 14:53:08 +01:00
parent 8e6a7bb852
commit d016e87eb8
4 changed files with 10 additions and 10 deletions

View File

@ -348,7 +348,7 @@ function getCpu() {
// socket type
try {
lines = [];
lines = execSync('dmidecode t 4 | grep "Upgrade: Socket"').toString().split('\n');
lines = execSync('dmidecode t 4 2>/dev/null | grep "Upgrade: Socket"').toString().split('\n');
if (lines && lines.length) {
result.socket = util.getValue(lines, 'Upgrade').replace('Socket', '').trim();
}
@ -362,7 +362,7 @@ function getCpu() {
let modelline = '';
let lines = [];
if (os.cpus()[0] && os.cpus()[0].model) modelline = os.cpus()[0].model;
exec('export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 ; unset LC_ALL', function (error, stdout) {
exec('export LC_ALL=C; dmidecode -t 4 2>/dev/null; dmidecode -t 7 2>/dev/null; unset LC_ALL', function (error, stdout) {
let cache = [];
if (!error) {
const data = stdout.toString().split('# dmidecode');
@ -789,7 +789,7 @@ function cpuFlags(callback) {
});
}
if (_freebsd || _openbsd) {
exec('export LC_ALL=C; dmidecode -t 4; unset LC_ALL', function (error, stdout) {
exec('export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL', function (error, stdout) {
let flags = [];
if (!error) {
let parts = stdout.toString().split('\tFlags:');
@ -867,7 +867,7 @@ function cpuCache(callback) {
});
}
if (_freebsd || _openbsd) {
exec('export LC_ALL=C; dmidecode -t 7 ; unset LC_ALL', function (error, stdout) {
exec('export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL', function (error, stdout) {
let cache = [];
if (!error) {
const data = stdout.toString();

View File

@ -167,7 +167,7 @@ function graphics(callback) {
// PCI bus IDs
let pciIDs = [];
try {
pciIDs = execSync('dmidecode -t 9 | grep "Bus Address: "').toString().split('\n');
pciIDs = execSync('dmidecode -t 9 2>/dev/null | grep "Bus Address: "').toString().split('\n');
for (let i = 0; i < pciIDs.length; i++) {
pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim();
}

View File

@ -90,7 +90,7 @@ const OSX_RAM_manufacturers = {
// Reference: http://www.software-architect.net/blog/article/date/2015/06/12/-826c6e5052.html
// /procs/meminfo - sample (all in kB)
//
//
// MemTotal: 32806380 kB
// MemFree: 19220948 kB
// MemAvailable: 20851100 kB
@ -261,7 +261,7 @@ function memLayout(callback) {
let result = [];
if (_linux || _freebsd || _openbsd) {
exec('export LC_ALL=C; dmidecode -t memory | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL', function (error, stdout) {
exec('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL', function (error, stdout) {
if (!error) {
let devices = stdout.toString().split('Memory Device');
devices.shift();

View File

@ -40,7 +40,7 @@ function system(callback) {
};
if (_linux || _freebsd || _openbsd) {
exec('dmidecode -t system', function (error, stdout) {
exec('dmidecode -t system 2>/dev/null', function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\n');
result.manufacturer = util.getValue(lines, 'manufacturer');
@ -234,7 +234,7 @@ function bios(callback) {
cmd = 'cat /proc/cpuinfo | grep Serial';
} else {
cmd = 'dmidecode --type 0';
cmd = 'dmidecode --type 0 2>/dev/null';
}
exec(cmd, function (error, stdout) {
if (!error) {
@ -318,7 +318,7 @@ function baseboard(callback) {
cmd = 'cat /proc/cpuinfo | grep Serial';
// 'BCM2709', 'BCM2835', 'BCM2708' -->
} else {
cmd = 'dmidecode -t 2';
cmd = 'dmidecode -t 2 2>/dev/null';
}
exec(cmd, function (error, stdout) {
if (!error) {