diff --git a/lib/system.js b/lib/system.js index b8206f6..b546548 100644 --- a/lib/system.js +++ b/lib/system.js @@ -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(); diff --git a/lib/util.js b/lib/util.js index c4daa8a..0c8185f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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();