diskLayout(), osInfo() fix parsing issues (mac OS)
This commit is contained in:
+1
-1
@@ -289,7 +289,7 @@ function osInfo(callback) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
result.serial = util.getValue(lines, 'kern.uuid');
|
||||
result.distro = util.getValue(lines, 'ProductName');
|
||||
result.release = util.getValue(lines, 'ProductVersion');
|
||||
result.release = (util.getValue(lines, 'ProductVersion', ':', true, true) + ' ' + util.getValue(lines, 'ProductVersionExtra', ':', true, true)).trim();
|
||||
result.build = util.getValue(lines, 'BuildVersion');
|
||||
result.logofile = getLogoFile(result.distro);
|
||||
result.codename = 'macOS';
|
||||
|
||||
+2
-1
@@ -119,7 +119,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
|
||||
trimmed = trimmed || false;
|
||||
lineMatch = lineMatch || false;
|
||||
let result = '';
|
||||
lines.forEach((line) => {
|
||||
lines.some((line) => {
|
||||
let lineLower = line.toLowerCase().replace(/\t/g, '');
|
||||
if (trimmed) {
|
||||
lineLower = lineLower.trim();
|
||||
@@ -129,6 +129,7 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
|
||||
if (parts.length >= 2) {
|
||||
parts.shift();
|
||||
result = parts.join(separator).trim();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user