fsSize() parsing improvement linux and alpine
This commit is contained in:
parent
4a499ebb8f
commit
58b64788a7
@ -137,7 +137,7 @@ function fsSize(drive, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_linux) {
|
if (_linux) {
|
||||||
cmd = 'df -lkPTx squashfs';
|
cmd = 'export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL';
|
||||||
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
|
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
|
||||||
return line.startsWith('/');
|
return line.startsWith('/');
|
||||||
}).forEach((line) => {
|
}).forEach((line) => {
|
||||||
@ -158,7 +158,7 @@ function fsSize(drive, callback) {
|
|||||||
return item.fs.toLowerCase().indexOf(drive.toLowerCase()) >= 0 || item.mount.toLowerCase().indexOf(drive.toLowerCase()) >= 0;
|
return item.fs.toLowerCase().indexOf(drive.toLowerCase()) >= 0 || item.mount.toLowerCase().indexOf(drive.toLowerCase()) >= 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!error || data.length) {
|
if ((!error || data.length) && stdout.toString().toLowerCase().indexOf('unrecognized option') === -1) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(data);
|
callback(data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user