Skip to content

Commit

Permalink
chassis(): new chassis detection (macOS)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed Dec 17, 2024
1 parent 30b13d7 commit 823503d
Show file tree
Hide file tree
Showing 3 changed files with 1,168 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,13 @@ function chassis(callback) {
exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {
if (!error) {
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
const model = util.getValue(lines, 'model', '=', true);
const modelParts = util.splitByNumber(model);
const version = util.getValue(lines, 'version', '=', true);
const model = util.getAppleModel(util.getValue(lines, 'model', '=', true));
// const modelParts = util.splitByNumber(model);
// const version = util.getValue(lines, 'version', '=', true);
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
result.model = version ? util.getValue(lines, 'model', '=', true) : modelParts[0];
result.type = macOsChassisType(result.model);
result.version = version || model;
result.model = model.model;
result.type = macOsChassisType(model.model);
result.version = model.version;
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
result.assetTag = util.getValue(lines, 'board-id', '=', true) || util.getValue(lines, 'target-type', '=', true);
result.sku = util.getValue(lines, 'target-sub-type', '=', true);
Expand Down
Loading

0 comments on commit 823503d

Please sign in to comment.