Skip to content

Commit

Permalink
[eas-cli] improvements to eas env:exec command (#2762)
Browse files Browse the repository at this point in the history
* [eas-cli] improvements to eas env:exec command

* add changelog
  • Loading branch information
szdziedzic authored Dec 13, 2024
1 parent 3f15439 commit 63e3c1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🧹 Chores

- Improve logging and validation in `eas env:exec` command. ([#2762](https://github.com/expo/eas-cli/pull/2762) by [@szdziedzic](https://github.com/szdziedzic))

## [14.1.0](https://github.com/expo/eas-cli/releases/tag/v14.1.0) - 2024-12-10

### 🎉 New features
Expand Down
31 changes: 11 additions & 20 deletions packages/eas-cli/src/commands/env/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,20 @@ export default class EnvExec extends EasCommand {
environment,
});

const secretEnvironmentVariables = environmentVariablesQueryResult.filter(
({ value }) => !value
);
if (secretEnvironmentVariables.length > 0) {
Log.warn(`The following environment variables are secret and cannot be downloaded locally:`);
for (const { name } of secretEnvironmentVariables) {
Log.warn(`- ${name}`);
}
Log.warn('Proceeding with the rest of the environment variables.');
Log.newLine();
}

const nonSecretEnvironmentVariables = environmentVariablesQueryResult.filter(
({ value }) => !!value
);
if (nonSecretEnvironmentVariables.length === 0) {
throw new Error('No readable environment variables found for the selected environment.');
}
Log.log(
`Loaded environment variables for the selected environment "${environment.toLowerCase()}":`
);
for (const { name } of nonSecretEnvironmentVariables) {
Log.log(`- ${name}`);

if (nonSecretEnvironmentVariables.length > 0) {
Log.log(
`Environment variables with visibility "Plain text" and "Sensitive" loaded from the "${environment.toLowerCase()}" environment on EAS: ${nonSecretEnvironmentVariables
.map(e => e.name)
.join(', ')}.`
);
} else {
Log.log(
`No environment variables with visibility "Plain text" and "Sensitive" found for the "${environment.toLowerCase()}" environment on EAS servers.`
);
}
Log.newLine();

Expand Down

0 comments on commit 63e3c1f

Please sign in to comment.