rename disks to filesystems

This commit is contained in:
Girish Ramakrishnan
2024-11-30 11:46:28 +01:00
parent f219abf082
commit 56f6519b3e
5 changed files with 44 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
'use strict';
exports = module.exports = {
disks,
filesystems,
file,
prettyBytes
};
@@ -36,10 +36,10 @@ function parseLine(line) {
};
}
async function disks() {
async function filesystems() {
const [error, output] = await safe(shell.spawn('df', ['-B1', '--output=source,fstype,size,used,avail,pcent,target'], { encoding: 'utf8', timeout: 5000 }));
if (error) {
debug(`disks: df command failed. error: ${error}\n stdout: ${error.stdout}\n stderr: ${error.stderr}`);
debug(`filesystems: df command failed. error: ${error}\n stdout: ${error.stdout}\n stderr: ${error.stderr}`);
throw new BoxError(BoxError.FS_ERROR, `Error running df: ${error.message}`);
}