diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d9fb405a7..d374cae9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ This is the log of notable changes to Expo CLI and related packages. ### 🎉 New features -- [expo-cli] EAS Build: Improve errors and wanrings when deprecating API [#2639](https://github.com/expo/expo-cli/pull/2639) +- [expo-cli] EAS Build: Improve errors and warnings when deprecating API [#2639](https://github.com/expo/expo-cli/pull/2639) +- [expo-cli] support `--config` flag in `expo credentials:manager` [#2641](https://github.com/expo/expo-cli/pull/2641) ### 🐛 Bug fixes diff --git a/packages/expo-cli/src/commands/credentials.ts b/packages/expo-cli/src/commands/credentials.ts index 6e6b1e9431..118f094844 100644 --- a/packages/expo-cli/src/commands/credentials.ts +++ b/packages/expo-cli/src/commands/credentials.ts @@ -16,24 +16,29 @@ type Options = { export default function (program: CommanderStatic) { program - .command('credentials:manager') + .command('credentials:manager [path]') .description('Manage your credentials') .helpGroup('credentials') .option('-p --platform ', 'Platform: [android|ios]', /^(android|ios)$/i) - .asyncAction(async (options: Options) => { - const projectDir = process.cwd(); - const context = new Context(); - await context.init(projectDir, { - nonInteractive: options.parent?.nonInteractive, - }); - let mainpage; - if (options.platform === 'android') { - mainpage = new SelectAndroidExperience(); - } else if (options.platform === 'ios') { - mainpage = new SelectIosExperience(); - } else { - mainpage = new SelectPlatform(); + .asyncActionProjectDir( + async (projectDir: string, options: Options) => { + const context = new Context(); + await context.init(projectDir, { + nonInteractive: options.parent?.nonInteractive, + }); + let mainpage; + if (options.platform === 'android') { + mainpage = new SelectAndroidExperience(); + } else if (options.platform === 'ios') { + mainpage = new SelectIosExperience(); + } else { + mainpage = new SelectPlatform(); + } + await runCredentialsManagerStandalone(context, mainpage); + }, + { + checkConfig: false, + skipSDKVersionRequirement: true, } - await runCredentialsManagerStandalone(context, mainpage); - }, /* skip project validation */ true); + ); } diff --git a/packages/expo-cli/src/credentials/context.ts b/packages/expo-cli/src/credentials/context.ts index 6c9473abc6..c41304e227 100644 --- a/packages/expo-cli/src/credentials/context.ts +++ b/packages/expo-cli/src/credentials/context.ts @@ -105,15 +105,15 @@ export class Context { this._appleCtxOptions = pick(options, ['appleId', 'appleIdPassword', 'teamId']); this._nonInteractive = options.nonInteractive; - // Check if we are in project context by looking for a manifest - const status = await Doctor.validateWithoutNetworkAsync(projectDir, { - skipSDKVersionRequirement: true, - }); - if (status !== Doctor.FATAL) { + // try to acccess project context + try { const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true }); this._manifest = exp; this._hasProjectContext = true; this.logOwnerAndProject(); + } catch (error) { + // ignore error + // startcredentials manager without project context } } }