Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed based on PR's reviews #10

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/cli-hermes/src/profileHermes/downloadProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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?',
Expand Down Expand Up @@ -123,6 +123,6 @@ export async function downloadProfile(
);
}
} catch (e) {
throw new CLIError('Failed to download the sampling profiler');
throw e;
}
}
8 changes: 4 additions & 4 deletions packages/cli-hermes/src/profileHermes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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',
},
Expand Down