convert more execSync to async

This commit is contained in:
Girish Ramakrishnan
2024-02-20 23:09:49 +01:00
parent b51071155a
commit 9b94cf18d0
15 changed files with 71 additions and 72 deletions

View File

@@ -329,8 +329,7 @@ async function getLogs(unit, options) {
}
async function getBlockDevices() {
const [error, result] = await safe(shell.promises.exec('getBlockDevices', 'lsblk --paths --json --list --fs', { encoding: 'utf8' }));
if (error) throw new BoxError(BoxError.INTERNAL_ERROR, `lsblk failed: ${error.message}`);
const result = await shell.promises.exec('getBlockDevices', 'lsblk --paths --json --list --fs', { encoding: 'utf8' });
const info = safe.JSON.parse(result);
if (!info) throw new BoxError(BoxError.INTERNAL_ERROR, `failed to parse lsblk: ${safe.error.message}`);