diff --git a/packages/cli-hermes/src/profileHermes/downloadProfile.ts b/packages/cli-hermes/src/profileHermes/downloadProfile.ts index 7f21d3e9f..201d8dd38 100644 --- a/packages/cli-hermes/src/profileHermes/downloadProfile.ts +++ b/packages/cli-hermes/src/profileHermes/downloadProfile.ts @@ -41,7 +41,7 @@ function execSyncWithLog(command: string) { export async function downloadProfile( ctx: Config, dstPath: string, - fileName?: string, + filename?: string, sourcemapPath?: string, raw?: boolean, shouldGenerateSourcemap?: boolean, @@ -52,7 +52,7 @@ export async function downloadProfile( const packageName = getPackageName(androidProject); // If file name is not specified, pull the latest file from device - const file = fileName || (await getLatestFile(packageName)); + const file = filename || (await getLatestFile(packageName)); if (!file) { throw new CLIError( 'There is no file in the cache/ directory. Did you record a profile from the developer menu?', @@ -123,6 +123,6 @@ export async function downloadProfile( ); } } catch (e) { - throw new CLIError('Failed to download the sampling profiler'); + throw e; } } diff --git a/packages/cli-hermes/src/profileHermes/index.ts b/packages/cli-hermes/src/profileHermes/index.ts index a824cb5d9..97b83746f 100644 --- a/packages/cli-hermes/src/profileHermes/index.ts +++ b/packages/cli-hermes/src/profileHermes/index.ts @@ -3,7 +3,7 @@ import {Config} from '@react-native-community/cli-types'; import {downloadProfile} from './downloadProfile'; type Options = { - fileName?: string; + filename?: string; raw?: boolean; sourcemapPath?: string; generateSourcemap?: boolean; @@ -19,13 +19,13 @@ async function profileHermes( logger.info( 'Downloading a Hermes Sampling Profiler from your Android device...', ); - if (!options.fileName) { + if (!options.filename) { logger.info('No filename is provided, pulling latest file'); } await downloadProfile( ctx, dstPath, - options.fileName, + options.filename, options.sourcemapPath, options.raw, options.generateSourcemap, @@ -43,7 +43,7 @@ export default { func: profileHermes, options: [ { - name: '--fileName [string]', + name: '--filename [string]', description: 'File name of the profile to be downloaded, eg. sampling-profiler-trace8593107139682635366.cpuprofile', },