system() fixed model Apple Silicon

This commit is contained in:
Sebastian Hildebrandt 2023-02-10 07:24:20 +01:00
parent bb0431eaf0
commit 7292158ba1
2 changed files with 2 additions and 2 deletions

View File

@ -216,7 +216,7 @@ function system(callback) {
if (!error) {
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
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.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase();

View File

@ -124,7 +124,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
if (trimmed) {
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);
if (parts.length >= 2) {
parts.shift();