bugfix diskLayout() (Windows)

This commit is contained in:
Sebastian Hildebrandt 2018-01-17 23:05:04 +01:00
parent f7e9d9389d
commit 57710ed96d
18 changed files with 23 additions and 22 deletions

View File

@ -99,6 +99,7 @@ Other changes
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 3.33.14 | 2018-01-17 | bugfix `diskLayout()` (Windows) |
| 3.33.13 | 2018-01-12 | bugfix `memLayout()` (Windows) | | 3.33.13 | 2018-01-12 | bugfix `memLayout()` (Windows) |
| 3.33.12 | 2017-12-25 | fixed typos | | 3.33.12 | 2017-12-25 | fixed typos |
| 3.33.11 | 2017-12-17 | updated docs | | 3.33.11 | 2017-12-17 | updated docs |

View File

@ -1,6 +1,6 @@
The MIT License (MIT) 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 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 this software and associated documentation files (the "Software"), to deal in

View File

@ -576,7 +576,7 @@ All other trademarks are the property of their respective owners.
>The [`MIT`][license-url] License (MIT) >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 >Permission is hereby granted, free of charge, to any person obtaining a copy
>of this software and associated documentation files (the "Software"), to deal >of this software and associated documentation files (the "Software"), to deal

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT
@ -237,7 +237,7 @@ function blockDevices(callback) {
}); });
} }
if (_windows) { 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) { exec(util.getWmic() + ' logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value', function (error, stdout) {
if (!error) { if (!error) {
let devices = stdout.toString().split(/\n\s*\n/); let devices = stdout.toString().split(/\n\s*\n/);
@ -543,7 +543,7 @@ function disksIO(callback) {
callback(result); callback(result);
} }
resolve(result); resolve(result);
}) });
} }
} else { } else {
result.rIO = _disk_io.rIO; result.rIO = _disk_io.rIO;
@ -671,7 +671,7 @@ function diskLayout(callback) {
sizeValue = parseInt(sizeStr); sizeValue = parseInt(sizeStr);
} }
if (sizeValue) { if (sizeValue) {
result.push({ result.push({
type: 'NVMe', type: 'NVMe',
name: util.getValue(lines, 'Model', ':', true).trim(), name: util.getValue(lines, 'Model', ':', true).trim(),
vendor: '', vendor: '',
@ -700,9 +700,9 @@ function diskLayout(callback) {
} }
if (_windows) { if (_windows) {
exec(util.getWmic() + ' diskdrive get /value', function (error, stdout) { exec(util.getWmic() + ' diskdrive get /value', {encoding: 'utf8'}, function (error, stdout) {
if (!error) { 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) { devices.forEach(function (device) {
let lines = device.split('\r\n'); let lines = device.split('\r\n');
const size = util.getValue(lines, 'Size', '=').trim(); const size = util.getValue(lines, 'Size', '=').trim();

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Contributors: Guillaume Legrain (https://github.com/glegrain) // Contributors: Guillaume Legrain (https://github.com/glegrain)

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,7 +4,7 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2017 // Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT