From d7366806dbe30069536ac7c46c204fb9e09c1c11 Mon Sep 17 00:00:00 2001 From: Jonas Hermsmeier Date: Thu, 2 Aug 2018 15:24:42 +0200 Subject: [PATCH] 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 --- lib/diskutil.js | 2 +- tests/diskutil.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/diskutil.js b/lib/diskutil.js index f402c0b8..1ac2f7fd 100644 --- a/lib/diskutil.js +++ b/lib/diskutil.js @@ -56,7 +56,7 @@ const transform = (disk) => { busType: disk.BusProtocol || 'UNKNOWN', busVersion: null, device: disk.DeviceNode, - devicePath: null, + devicePath: disk.DeviceTreePath || null, raw: disk.DeviceNode && disk.DeviceNode.replace('/disk', '/rdisk'), description: disk.IORegistryEntryName || disk.MediaName, error: null, diff --git a/tests/diskutil.spec.js b/tests/diskutil.spec.js index 0715e9c3..31c8e59f 100644 --- a/tests/diskutil.spec.js +++ b/tests/diskutil.spec.js @@ -44,7 +44,7 @@ describe('Drivelist', function() { busType: 'PCI-Express', busVersion: null, device: '/dev/disk1', - devicePath: null, + devicePath: 'IODeviceTree:/PCI0@0/RP17@1B/SSD0@0/IONVMeController', raw: '/dev/rdisk1', description: 'Macintosh HD', error: null,