diskLayout(), osInfo() fix parsing issues (mac OS)

This commit is contained in:
Sebastian Hildebrandt
2023-05-29 10:20:00 +02:00
parent 20d5d30722
commit 3fa3341697
5 changed files with 16 additions and 9 deletions
+1 -1
View File
@@ -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
View File
@@ -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;
}
}
});