system() fixed model Apple Silicon
This commit is contained in:
parent
bb0431eaf0
commit
7292158ba1
@ -216,7 +216,7 @@ function system(callback) {
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
|
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
|
||||||
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
||||||
result.model = util.getValue(lines, 'model', '=', true);
|
result.model = util.getValue(lines, 'model', '=', true, true);
|
||||||
result.version = util.getValue(lines, 'version', '=', true);
|
result.version = util.getValue(lines, 'version', '=', true);
|
||||||
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
|
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
|
||||||
result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase();
|
result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase();
|
||||||
|
|||||||
@ -124,7 +124,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
|
|||||||
if (trimmed) {
|
if (trimmed) {
|
||||||
lineLower = lineLower.trim();
|
lineLower = lineLower.trim();
|
||||||
}
|
}
|
||||||
if (lineLower.startsWith(property) && (lineMatch ? (lineLower.match(property + separator)) : true)) {
|
if (lineLower.startsWith(property) && (lineMatch ? (lineLower.match(property + separator)) || (lineLower.match(property + ' ' + separator)) : true)) {
|
||||||
const parts = trimmed ? line.trim().split(separator) : line.split(separator);
|
const parts = trimmed ? line.trim().split(separator) : line.split(separator);
|
||||||
if (parts.length >= 2) {
|
if (parts.length >= 2) {
|
||||||
parts.shift();
|
parts.shift();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user