From 3a6f2c127afe8a48c7b98cfc053e5fc204081d25 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 7 Nov 2021 04:48:54 -0800 Subject: [PATCH] extract: Add flag to skip flag copying This is useful for testing. --- src/commands/extract.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commands/extract.ts b/src/commands/extract.ts index 18dde5a..430cbac 100644 --- a/src/commands/extract.ts +++ b/src/commands/extract.ts @@ -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')))