diskLayout() fixed issue linux

This commit is contained in:
Sebastian Hildebrandt
2020-06-03 20:03:32 +02:00
parent 1a9f9a5af9
commit 4c297cde70
4 changed files with 20 additions and 11 deletions
+12 -9
View File
@@ -735,20 +735,21 @@ function diskLayout(callback) {
return new Promise((resolve) => {
process.nextTick(() => {
const commitResult = res => {
for (let i = 0; i < res.length; i++) {
delete res[i].BSDName;
}
if (callback) {
callback(res);
}
resolve(res);
};
let result = [];
let cmd = '';
if (_linux) {
let cmdFullSmart = '';
const commitResult = res => {
for (let i = 0; i < res.length; i++) {
delete res[i].BSDName;
}
if (callback) {
callback(res);
}
resolve(res);
};
exec('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL', function (error, stdout) {
if (!error) {
@@ -854,6 +855,8 @@ function diskLayout(callback) {
}
}
});
} else {
commitResult(result);
}
});
}