Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[cli] fix skip creds flag (#2213)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinlanj authored Jun 4, 2020
1 parent f875c67 commit 50edd2a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/expo-cli/src/commands/build/ios/IOSBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ class IOSBuilder extends BaseBuilder {

// Try to get the user to provide Apple credentials upfront
// We will be able to do full validation of their iOS creds this way
async bestEffortAppleCtx(ctx: Context, bundleIdentifier: string) {
async bestEffortAppleCtx(ctx: Context): Promise<void> {
if (ctx.hasAppleCtx()) {
// skip prompts if already have apple ctx
return;
}
if (this.options.appleId) {
// skip prompts and auto authenticate if flags are passed
return await ctx.ensureAppleCtx(this.options);
}

const nonInteractive = this.options.parent && this.options.parent.nonInteractive;
if (nonInteractive) {
return null;
return;
}

const { confirm } = await prompt([
Expand Down Expand Up @@ -122,14 +127,16 @@ class IOSBuilder extends BaseBuilder {
if (!bundleIdentifier) throw missingBundleIdentifierError();
const context = new Context();
await context.init(this.projectDir);
await this.bestEffortAppleCtx(context, bundleIdentifier);

await this.clearAndRevokeCredentialsIfRequested(context, { experienceName, bundleIdentifier });

if (this.options.skipCredentialsCheck) {
log('Skipping credentials check...');
return;
}
await this.bestEffortAppleCtx(context);

try {
if (this.options.skipCredentialsCheck) {
log('Skipping credentials check...');
return;
}
await this.produceCredentials(context, experienceName, bundleIdentifier);
} catch (e) {
if (e.code === ErrorCodes.NON_INTERACTIVE) {
Expand Down

0 comments on commit 50edd2a

Please sign in to comment.