extract: Add flag to skip flag copying

This is useful for testing.
This commit is contained in:
Danny Lin 2021-11-07 04:48:54 -08:00
parent a7628cccb3
commit 3a6f2c127a

View file

@ -68,12 +68,13 @@ export default class Extract extends Command {
vendor: flags.string({char: 'v', description: 'device vendor/OEM name', required: true}),
device: flags.string({char: 'd', description: 'device codename', required: true}),
source: flags.string({char: 's', description: 'path to mounted factory images', required: true}),
skipCopy: flags.boolean({char: 'k', description: 'skip file copying and only generate build files'}),
}
static args = [{name: 'listPath'}]
async run() {
let {args: {listPath}, flags: {vendor, device, source}} = this.parse(Extract)
let {args: {listPath}, flags: {vendor, device, source, skipCopy}} = this.parse(Extract)
// Parse list
this.log(chalk.bold(chalk.greenBright('Parsing list')))
@ -88,7 +89,9 @@ export default class Extract extends Command {
await fs.mkdir(proprietaryDir, {recursive: true})
// Copy blobs
await copyBlobs(entries, source, proprietaryDir)
if (!skipCopy) {
await copyBlobs(entries, source, proprietaryDir)
}
// Generate build files
this.log(chalk.bold(chalk.greenBright('Generating build files')))