collect-state: Support dir/<device>.json independent of multi-device
This commit is contained in:
parent
fbf152fb63
commit
830d5e939e
1 changed files with 2 additions and 1 deletions
|
@ -27,11 +27,12 @@ export default class CollectState extends Command {
|
|||
parallel,
|
||||
}, args: {output_path: outPath}} = this.parse(CollectState)
|
||||
|
||||
let isDir = (await fs.stat(outPath)).isDirectory()
|
||||
await forEachDevice(devices, parallel, async (device) => {
|
||||
let state = await collectSystemState(device, outRoot, aapt2Path)
|
||||
|
||||
// Write
|
||||
let devicePath = devices.length > 1 ? `${outPath}/${device}.json` : outPath
|
||||
let devicePath = isDir ? `${outPath}/${device}.json` : outPath
|
||||
await fs.writeFile(devicePath, serializeSystemState(state))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue