diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 754fd540..1d89cdd7 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -73,6 +73,10 @@ yargs(hideBin(process.argv)) describe: 'Override the output directory for unminify (default: out/unminify/)', type: 'string', }) + .option('perf-output', { + describe: 'Specify the output directory (default: /)', + type: 'string', + }) .option('force', { alias: 'f', describe: 'Force overwrite output directory', @@ -438,6 +442,7 @@ async function nonInteractive(features: Feature[], { output: _output, 'unpacker-output': _unpackerOutput, 'unminify-output': _unminifyOutput, + 'perf-output': _perfOutput, force = false, concurrency = 1, perf, @@ -446,6 +451,7 @@ async function nonInteractive(features: Feature[], { output: string | undefined 'unpacker-output': string | undefined 'unminify-output': string | undefined + 'perf-output': string | undefined force: boolean | undefined concurrency: number | undefined perf: boolean | undefined @@ -480,14 +486,15 @@ async function nonInteractive(features: Feature[], { const unpackerOutput = _unpackerOutput ?? (singleFeature ? outputBase : path.join(outputBase, defaultUnpackerOutputFolder)) const unminifyOutput = _unminifyOutput ?? (singleFeature ? outputBase : path.join(outputBase, defaultUnminifyOutputFolder)) - const perfOutputBase = singleFeature + const perfOutputBase = _perfOutput || (singleFeature ? features.includes(Feature.Unpacker) ? unpackerOutput : unminifyOutput - : findCommonBaseDir([unpackerOutput, unminifyOutput]) ?? outputBase + : findCommonBaseDir([unpackerOutput, unminifyOutput]) ?? outputBase) const perfOutputPath = path.join(perfOutputBase, 'perf.json') const outputPathsToCheck = [] if (features.includes(Feature.Unpacker)) outputPathsToCheck.push(unpackerOutput) if (features.includes(Feature.Unminify)) outputPathsToCheck.push(unminifyOutput) + outputPathsToCheck.push(perfOutputPath) const outputValidationError = getValidateFromPaths(outputPathsToCheck, outputFolderValidation) if (outputValidationError) {