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