Skip to content

Commit 823503d

Browse files
chassis(): new chassis detection (macOS)
1 parent 30b13d7 commit 823503d

File tree

3 files changed

+1168
-7
lines changed

3 files changed

+1168
-7
lines changed

lib/system.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,13 @@ function chassis(callback) {
688688
exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {
689689
if (!error) {
690690
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
691-
const model = util.getValue(lines, 'model', '=', true);
692-
const modelParts = util.splitByNumber(model);
693-
const version = util.getValue(lines, 'version', '=', true);
691+
const model = util.getAppleModel(util.getValue(lines, 'model', '=', true));
692+
// const modelParts = util.splitByNumber(model);
693+
// const version = util.getValue(lines, 'version', '=', true);
694694
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
695-
result.model = version ? util.getValue(lines, 'model', '=', true) : modelParts[0];
696-
result.type = macOsChassisType(result.model);
697-
result.version = version || model;
695+
result.model = model.model;
696+
result.type = macOsChassisType(model.model);
697+
result.version = model.version;
698698
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
699699
result.assetTag = util.getValue(lines, 'board-id', '=', true) || util.getValue(lines, 'target-type', '=', true);
700700
result.sku = util.getValue(lines, 'target-sub-type', '=', true);

0 commit comments

Comments
 (0)