Skip to content

Commit

Permalink
[eas-cli] amend credential removal wording (#2334)
Browse files Browse the repository at this point in the history
* Temporary Commit at 4/18/2024, 8:40:55 PM

* update CHANGELOG.md
  • Loading branch information
quinlanj authored Apr 19, 2024
1 parent 0c70604 commit 44cd3b2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🧹 Chores

- Amend credential removal wording. ([#2334](https://github.com/expo/eas-cli/pull/2334) by [@quinlanj](https://github.com/quinlanj))

## [7.8.2](https://github.com/expo/eas-cli/releases/tag/v7.8.2) - 2024-04-15

### 🐛 Bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ export function formatDistributionCertificate(
buildCredentials => buildCredentials.iosAppCredentials.app
);
if (apps.length) {
const appFullNames = apps.map(app => app.fullName).join(',');
line += chalk.gray(`\n 📲 Used by: ${appFullNames}`);
// iosAppBuildCredentialsList is capped at 20 on www
const appFullNames = apps
.map(app => app.fullName)
.slice(0, 19)
.join(',');
const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
line += chalk.gray(`\n 📲 Used by: ${appFullNames}${andMaybeMore}`);
}

if (validSerialNumbers?.includes(serialNumber)) {
Expand Down
9 changes: 7 additions & 2 deletions packages/eas-cli/src/credentials/ios/actions/PushKeyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ export function formatPushKey(

const apps = pushKey.iosAppCredentialsList.map(appCredentials => appCredentials.app);
if (apps.length) {
const appFullNames = apps.map(app => app.fullName).join(',');
line += chalk.gray(`\n 📲 Used by: ${appFullNames}`);
// iosAppCredentialsList is capped at 20 on www
const appFullNames = apps
.map(app => app.fullName)
.slice(0, 19)
.join(',');
const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
line += chalk.gray(`\n 📲 Used by: ${appFullNames}${andMaybeMore}`);
}

if (validPushKeyIdentifiers?.includes(keyIdentifier)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ export class RemoveDistributionCertificate {
buildCredentials => buildCredentials.iosAppCredentials.app
);
if (apps.length !== 0) {
const appFullNames = apps.map(app => app.fullName).join(',');
// iosAppBuildCredentialsList is capped at 20 on www
const appFullNames = apps
.map(app => app.fullName)
.slice(0, 19)
.join(',');
const andMaybeMore = apps.length > 19 ? ' (and more)' : '';

if (ctx.nonInteractive) {
throw new Error(
`Certificate is currently used by ${appFullNames} and cannot be deleted in non-interactive mode.`
`Certificate is currently used by ${appFullNames}${andMaybeMore} and cannot be deleted in non-interactive mode.`
);
}
const confirm = await confirmAsync({
message: `You are removing certificate used by ${appFullNames}. Do you want to continue?`,
message: `You are removing certificate used by ${appFullNames}${andMaybeMore}. Do you want to continue?`,
});
if (!confirm) {
Log.log('Aborting');
Expand Down
9 changes: 7 additions & 2 deletions packages/eas-cli/src/credentials/ios/actions/RemovePushKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ export class RemovePushKey {

const apps = this.pushKey.iosAppCredentialsList.map(appCredentials => appCredentials.app);
if (apps.length !== 0) {
const appFullNames = apps.map(app => app.fullName).join(',');
// iosAppCredentialsList is capped at 20 on www
const appFullNames = apps
.map(app => app.fullName)
.slice(0, 19)
.join(',');
const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
const confirm = await confirmAsync({
message: `Removing this push key will disable push notifications for ${appFullNames}. Do you want to continue?`,
message: `Removing this push key will disable push notifications for ${appFullNames}${andMaybeMore}. Do you want to continue?`,
});
if (!confirm) {
Log.log('Aborting');
Expand Down

0 comments on commit 44cd3b2

Please sign in to comment.