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
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+6 -6
View File
@@ -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();
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT
+1 -1
View File
@@ -4,7 +4,7 @@
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 2017
// Copyright: (c) 2014 - 2018
// Author: Sebastian Hildebrandt
// ----------------------------------------------------------------------------------
// License: MIT