du: exclude option
This commit is contained in:
@@ -26,8 +26,11 @@ const apps = require('./apps.js'),
|
||||
|
||||
const DU_CMD = path.join(__dirname, 'scripts/du.sh');
|
||||
|
||||
async function du(file) {
|
||||
const [error, stdoutResult] = await safe(shell.promises.sudo('system', [ DU_CMD, file ], {}));
|
||||
async function du(file, options) {
|
||||
assert.strictEqual(typeof file, 'string');
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
|
||||
const [error, stdoutResult] = await safe(shell.promises.sudo('system', [ DU_CMD, file, options.exclude || '' ], {}));
|
||||
if (error) throw new BoxError(BoxError.FS_ERROR, error);
|
||||
|
||||
return parseInt(stdoutResult.trim(), 10);
|
||||
|
||||
Reference in New Issue
Block a user