convert more execSync to async
This commit is contained in:
@@ -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}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user