Skip to content

Commit

Permalink
Display message when env:list returns an empty result (#2630)
Browse files Browse the repository at this point in the history
# Why

[ENG-13847: Show `no env vars found for this environment` if 0 env vars exist for given environment in `eas env:list`](https://linear.app/expo/issue/ENG-13847/show-no-env-vars-found-for-this-environment-if-0-env-vars-exist-for)

<img width="455" alt="image" src="https://github.com/user-attachments/assets/d4286fcb-0adf-4806-a876-4cbbcf3d6157">
  • Loading branch information
khamilowicz authored Oct 18, 2024
1 parent 1cc4fd8 commit 1873804
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/eas-cli/src/commands/env/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ export default class EnvironmentValueList extends EasCommand {
Log.log(chalk.bold(`Environment: ${environment.toLocaleLowerCase()}`));
}

if (variables.length === 0) {
Log.log('No variables found for this environment.');
return;
}

if (format === 'short') {
for (const variable of variables) {
Log.log(`${chalk.bold(variable.name)}=${formatVariableValue(variable)}`);
Expand Down

0 comments on commit 1873804

Please sign in to comment.