code cleanup
This commit is contained in:
parent
ad2870c0a8
commit
7c3e5f2c29
@ -401,7 +401,7 @@ function graphics(callback) {
|
||||
let cmd = 'fbset -s | grep \'mode "\'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;';
|
||||
exec(cmd, function (error, stdout) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
if (lines.length > 3 && lines[0].indexOf('mode "' >= -1) && lines[2].indexOf('0x12000a') > -1) {
|
||||
if (lines.length > 3 && lines[0].indexOf('mode "') >= -1 && lines[2].indexOf('0x12000a') > -1) {
|
||||
const parts = lines[0].replace('mode', '').replace(/"/g, '').trim().split('x');
|
||||
if (parts.length === 2) {
|
||||
result.displays.push({
|
||||
@ -417,7 +417,7 @@ function graphics(callback) {
|
||||
})
|
||||
}
|
||||
}
|
||||
if (lines.length > 1 && lines[1].indexOf('gpu=' >= -1)) {
|
||||
if (lines.length > 1 && lines[1].indexOf('gpu=') >= -1) {
|
||||
result.controllers.push({
|
||||
vendor: 'Broadcom',
|
||||
model: 'VideoCore IV',
|
||||
|
||||
@ -214,7 +214,7 @@ function osInfo(callback) {
|
||||
callback(result);
|
||||
}
|
||||
resolve(result);
|
||||
})
|
||||
});
|
||||
//}
|
||||
});
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ function getCodepage() {
|
||||
if (!codepage) {
|
||||
try {
|
||||
const stdout = execSync('echo $LANG');
|
||||
lines = stdout.toString().split('\r\n');
|
||||
const lines = stdout.toString().split('\r\n');
|
||||
const parts = lines[0].split('.');
|
||||
codepage = parts.length > 1 ? parts[1].trim() : '';
|
||||
if (!codepage) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user