diskLayout() fix parsing linux (JSON)
This commit is contained in:
+1
-1
@@ -852,7 +852,7 @@ function diskLayout(callback) {
|
||||
try {
|
||||
const outJSON = JSON.parse(out);
|
||||
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
|
||||
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null)); });
|
||||
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fsType === null && item.parttype === null && item.name.indexOf('ram') !== 0)); });
|
||||
}
|
||||
} catch (e) {
|
||||
// fallback to older version of lsblk
|
||||
|
||||
Reference in New Issue
Block a user