shell: no need to promise scoping
This commit is contained in:
+2
-2
@@ -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', {}));
|
||||
const [error, stdout] = await safe(shell.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', {});
|
||||
const result = await shell.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}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user