Skip to content

Commit a4ea7c5

Browse files
committed
feat(diskutil): Populate devicePath on Mac OS
This exposes the device tree path under the `.devicePath` property Change-type: minor Signed-off-by: Jonas Hermsmeier <jhermsmeier@gmail.com>
1 parent 7ccbeb1 commit a4ea7c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/diskutil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const transform = (disk) => {
5656
busType: disk.BusProtocol || 'UNKNOWN',
5757
busVersion: null,
5858
device: disk.DeviceNode,
59-
devicePath: null,
59+
devicePath: disk.DeviceTreePath || null,
6060
raw: disk.DeviceNode && disk.DeviceNode.replace('/disk', '/rdisk'),
6161
description: disk.IORegistryEntryName || disk.MediaName,
6262
error: null,

tests/diskutil.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Drivelist', function() {
4444
busType: 'PCI-Express',
4545
busVersion: null,
4646
device: '/dev/disk1',
47-
devicePath: null,
47+
devicePath: 'IODeviceTree:/PCI0@0/RP17@1B/SSD0@0/IONVMeController',
4848
raw: '/dev/rdisk1',
4949
description: 'Macintosh HD',
5050
error: null,
@@ -98,7 +98,7 @@ describe('Drivelist', function() {
9898
busType: 'USB',
9999
busVersion: null,
100100
device: '/dev/disk3',
101-
devicePath: null,
101+
devicePath: 'IODeviceTree:/PCI0@0/XHC1@14',
102102
raw: '/dev/rdisk3',
103103
description: 'APPLE SD Card Reader Media',
104104
error: null,

0 commit comments

Comments
 (0)