Skip to content

Commit

Permalink
[ENG-9927][eas-cli] add profile flag to eas build:run command (#2035
Browse files Browse the repository at this point in the history
)

* [eas-cli] add `profile` flag to `eas build:run` command

* update CHANGELOG.md
  • Loading branch information
szdziedzic authored Nov 15, 2023
1 parent fea7913 commit 7c48b2b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🎉 New features

- Add `--profile` flag to `eas build:run` command. ([#2035](https://github.com/expo/eas-cli/pull/2035) by [@szdziedzic](https://github.com/szdziedzic))

### 🐛 Bug fixes

### 🧹 Chores
Expand Down
17 changes: 16 additions & 1 deletion packages/eas-cli/src/commands/build/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ interface RawRunFlags {
platform?: string;
limit?: number;
offset?: number;
profile?: string;
}

interface RunCommandFlags {
selectedPlatform: AppPlatform;
runArchiveFlags: RunArchiveFlags;
limit?: number;
offset?: number;
profile?: string;
}

export default class Run extends EasCommand {
Expand All @@ -66,6 +68,12 @@ export default class Run extends EasCommand {
char: 'p',
options: ['android', 'ios'],
}),
profile: Flags.string({
char: 'e',
description:
'Name of the build profile used to create the build to run. When specified, only builds created with the specified build profile will be queried.',
helpValue: 'PROFILE_NAME',
}),
...EasPaginatedQueryFlags,
};

Expand Down Expand Up @@ -98,7 +106,7 @@ export default class Run extends EasCommand {
}

private async sanitizeFlagsAsync(flags: RawRunFlags): Promise<RunCommandFlags> {
const { platform, limit, offset, ...runArchiveFlags } = flags;
const { platform, limit, offset, profile, ...runArchiveFlags } = flags;

const selectedPlatform = await resolvePlatformAsync(platform);

Expand All @@ -122,11 +130,16 @@ export default class Run extends EasCommand {
});
}

if (profile && (runArchiveFlags.id || runArchiveFlags.path || runArchiveFlags.url)) {
Log.warn('The --profile flag is ignored when using --id, --path, or --url flags.');
}

return {
selectedPlatform,
runArchiveFlags,
limit,
offset,
profile,
};
}
}
Expand Down Expand Up @@ -208,6 +221,7 @@ async function maybeGetBuildAsync(
platform: flags.selectedPlatform,
distribution: distributionType,
status: BuildStatus.Finished,
buildProfile: flags.profile,
},
paginatedQueryOptions,
selectPromptDisabledFunction: build => !isRunnableOnSimulatorOrEmulator(build),
Expand All @@ -223,6 +237,7 @@ async function maybeGetBuildAsync(
platform: flags.selectedPlatform,
distribution: distributionType,
status: BuildStatus.Finished,
buildProfile: flags.profile,
},
});

Expand Down

0 comments on commit 7c48b2b

Please sign in to comment.