From 57710ed96d8a7f75c89167cba8f2ff6574c346c2 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 17 Jan 2018 23:05:04 +0100 Subject: [PATCH] bugfix diskLayout() (Windows) --- CHANGELOG.md | 1 + LICENSE | 2 +- README.md | 2 +- lib/battery.js | 2 +- lib/cpu.js | 2 +- lib/docker.js | 2 +- lib/dockerSocket.js | 2 +- lib/filesystem.js | 12 ++++++------ lib/graphics.js | 2 +- lib/index.js | 2 +- lib/internet.js | 2 +- lib/memory.js | 2 +- lib/network.js | 2 +- lib/osinfo.js | 2 +- lib/processes.js | 2 +- lib/system.js | 2 +- lib/users.js | 2 +- lib/util.js | 2 +- 18 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b9d2fb..5ab3ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ Other changes | Version | Date | Comment | | -------------- | -------------- | -------- | +| 3.33.14 | 2018-01-17 | bugfix `diskLayout()` (Windows) | | 3.33.13 | 2018-01-12 | bugfix `memLayout()` (Windows) | | 3.33.12 | 2017-12-25 | fixed typos | | 3.33.11 | 2017-12-17 | updated docs | diff --git a/LICENSE b/LICENSE index 0eefbf3..e6c1a6e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2017 Sebastian Hildebrandt +Copyright (c) 2014-2018 Sebastian Hildebrandt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index ffc93e9..e437b31 100644 --- a/README.md +++ b/README.md @@ -576,7 +576,7 @@ All other trademarks are the property of their respective owners. >The [`MIT`][license-url] License (MIT) > ->Copyright © 2014-2017 Sebastian Hildebrandt, [+innovations](http://www.plus-innovations.com). +>Copyright © 2014-2018 Sebastian Hildebrandt, [+innovations](http://www.plus-innovations.com). > >Permission is hereby granted, free of charge, to any person obtaining a copy >of this software and associated documentation files (the "Software"), to deal diff --git a/lib/battery.js b/lib/battery.js index 42c6a52..6ccc7d8 100644 --- a/lib/battery.js +++ b/lib/battery.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/cpu.js b/lib/cpu.js index 651605e..a677ba2 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/docker.js b/lib/docker.js index dacf4a5..6f84214 100644 --- a/lib/docker.js +++ b/lib/docker.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/dockerSocket.js b/lib/dockerSocket.js index c0d3c63..605c1af 100644 --- a/lib/dockerSocket.js +++ b/lib/dockerSocket.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/filesystem.js b/lib/filesystem.js index e9663d8..683fd6d 100644 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT @@ -237,7 +237,7 @@ function blockDevices(callback) { }); } if (_windows) { - let drivetypes = ['Unknown', 'NoRoot', 'Removable', 'HDD', 'Network', 'CD/DVD', 'RAM'] + let drivetypes = ['Unknown', 'NoRoot', 'Removable', 'HDD', 'Network', 'CD/DVD', 'RAM']; exec(util.getWmic() + ' logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value', function (error, stdout) { if (!error) { let devices = stdout.toString().split(/\n\s*\n/); @@ -543,7 +543,7 @@ function disksIO(callback) { callback(result); } resolve(result); - }) + }); } } else { result.rIO = _disk_io.rIO; @@ -671,7 +671,7 @@ function diskLayout(callback) { sizeValue = parseInt(sizeStr); } if (sizeValue) { - result.push({ + result.push({ type: 'NVMe', name: util.getValue(lines, 'Model', ':', true).trim(), vendor: '', @@ -700,9 +700,9 @@ function diskLayout(callback) { } if (_windows) { - exec(util.getWmic() + ' diskdrive get /value', function (error, stdout) { + exec(util.getWmic() + ' diskdrive get /value', {encoding: 'utf8'}, function (error, stdout) { if (!error) { - let devices = stdout.toString().split('\r\n\r\n\r\n'); + let devices = stdout.toString().split(/\n\s*\n/); devices.forEach(function (device) { let lines = device.split('\r\n'); const size = util.getValue(lines, 'Size', '=').trim(); diff --git a/lib/graphics.js b/lib/graphics.js index 959192b..6f283cc 100644 --- a/lib/graphics.js +++ b/lib/graphics.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/index.js b/lib/index.js index c1d7984..815f54e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // Contributors: Guillaume Legrain (https://github.com/glegrain) diff --git a/lib/internet.js b/lib/internet.js index c801f27..34aaa3a 100644 --- a/lib/internet.js +++ b/lib/internet.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/memory.js b/lib/memory.js index 5dd94f0..91cdf6f 100644 --- a/lib/memory.js +++ b/lib/memory.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/network.js b/lib/network.js index ab48286..9ae305b 100644 --- a/lib/network.js +++ b/lib/network.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/osinfo.js b/lib/osinfo.js index 04381d0..ef84739 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/processes.js b/lib/processes.js index 87576b5..5cef6a3 100644 --- a/lib/processes.js +++ b/lib/processes.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/system.js b/lib/system.js index f054eb5..4f684a4 100644 --- a/lib/system.js +++ b/lib/system.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/users.js b/lib/users.js index 8a2af14..981aaa9 100644 --- a/lib/users.js +++ b/lib/users.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT diff --git a/lib/util.js b/lib/util.js index 28f6d6a..257bda1 100644 --- a/lib/util.js +++ b/lib/util.js @@ -4,7 +4,7 @@ // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js -// Copyright: (c) 2014 - 2017 +// Copyright: (c) 2014 - 2018 // Author: Sebastian Hildebrandt // ---------------------------------------------------------------------------------- // License: MIT