Skip to content

Commit

Permalink
prompt the user to choose a profile
Browse files Browse the repository at this point in the history
  • Loading branch information
FiberJW committed Mar 18, 2024
1 parent 04d2a29 commit 227bce7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/eas-cli/src/commands/credentials/configure-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Platform } from '@expo/eas-build-job';
import { Flags } from '@oclif/core';

import EasCommand from '../../commandUtils/EasCommand';
import { SelectBuildProfileFromEasJson } from '../../credentials/manager/SelectBuildProfileFromEasJson';
import { SetUpBuildCredentialsCommandAction } from '../../credentials/manager/SetUpBuildCredentialsCommandAction';
import { selectPlatformAsync } from '../../platform';

Expand All @@ -17,13 +18,12 @@ export default class InitializeBuildCredentials extends EasCommand {
char: 'e',
description: 'The name of the build profile in eas.json.',
helpValue: 'PROFILE_NAME',
required: true,
}),
};

static override contextDefinition = {
...this.ContextOptions.LoggedIn,
...this.ContextOptions.OptionalProjectConfig,
...this.ContextOptions.ProjectConfig,
...this.ContextOptions.DynamicProjectConfig,
...this.ContextOptions.Analytics,
...this.ContextOptions.Vcs,
Expand All @@ -43,6 +43,13 @@ export default class InitializeBuildCredentials extends EasCommand {

const platform = await selectPlatformAsync(flags.platform);

const buildProfile =
flags.profile ??
(await new SelectBuildProfileFromEasJson(
privateProjectConfig.projectDir,
Platform.IOS
).getProfileNameFromEasConfigAsync());

await new SetUpBuildCredentialsCommandAction(
actor,
graphqlClient,
Expand All @@ -51,7 +58,7 @@ export default class InitializeBuildCredentials extends EasCommand {
privateProjectConfig ?? null,
getDynamicPrivateProjectConfigAsync,
platform,
flags.profile
buildProfile
).runAsync();
}
}

0 comments on commit 227bce7

Please sign in to comment.