shell: exec encoding is utf8 by default and no shell

explicitly mark calls that require the shell
This commit is contained in:
Girish Ramakrishnan
2024-02-21 17:16:33 +01:00
parent 23cac99fe9
commit 14c9260ab0
14 changed files with 54 additions and 51 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ async function hdparm(file) {
}
async function getSwaps() {
const [error, stdout] = await safe(shell.promises.exec('getSwaps', 'swapon --noheadings --raw --bytes --show=type,size,used,name', { encoding: 'utf8' }));
const [error, stdout] = await safe(shell.promises.exec('getSwaps', 'swapon --noheadings --raw --bytes --show=type,size,used,name', {}));
if (error) return {};
const swaps = {};
@@ -329,7 +329,7 @@ async function getLogs(unit, options) {
}
async function getBlockDevices() {
const result = await shell.promises.exec('getBlockDevices', 'lsblk --paths --json --list --fs', { encoding: 'utf8' });
const result = await shell.promises.exec('getBlockDevices', 'lsblk --paths --json --list --fs', {});
const info = safe.JSON.parse(result);
if (!info) throw new BoxError(BoxError.INTERNAL_ERROR, `failed to parse lsblk: ${safe.error.message}`);