Deprecate envs command in favor of env list

Change-type: patch
This commit is contained in:
myarmolinsky 2024-09-24 14:52:59 -04:00
parent e8ed309094
commit cdec4a6847
3 changed files with 5 additions and 7 deletions

View File

@ -2188,7 +2188,7 @@ port mapping in the format <remotePort>[:[localIP:]localPort]
### Aliases ### Aliases
- `envs` - `envs` *(deprecated)*
To use one of the aliases, replace `env list` with the alias. To use one of the aliases, replace `env list` with the alias.

View File

@ -47,6 +47,7 @@ interface ServiceEnvironmentVariableInfo
export default class EnvListCmd extends Command { export default class EnvListCmd extends Command {
public static aliases = ['envs']; public static aliases = ['envs'];
public static deprecateAliases = true;
public static description = stripIndent` public static description = stripIndent`
List the environment or config variables of a fleet, device or service. List the environment or config variables of a fleet, device or service.

View File

@ -65,20 +65,17 @@ describe('balena env list', function () {
api.expectGetAppEnvVars(); api.expectGetAppEnvVars();
api.expectGetAppServiceVars(); api.expectGetAppServiceVars();
const { out, err } = await runCommand(`envs -f ${appName}`); const { out } = await runCommand(`envs -f ${appName}`);
expect(out.join('')).to.satisfy((msg: string) => expect(out.join('')).to.contain(
msg.endsWith( stripIndent`
stripIndent`
ID NAME VALUE FLEET SERVICE ID NAME VALUE FLEET SERVICE
120110 svar1 svar1-value gh_user/testApp service1 120110 svar1 svar1-value gh_user/testApp service1
120111 svar2 svar2-value gh_user/testApp service2 120111 svar2 svar2-value gh_user/testApp service2
120101 var1 var1-val gh_user/testApp * 120101 var1 var1-val gh_user/testApp *
120102 var2 22 gh_user/testApp * 120102 var2 22 gh_user/testApp *
` + '\n', ` + '\n',
),
); );
expect(err.join('')).to.equal('');
}); });
it('should successfully list config vars for a test fleet', async () => { it('should successfully list config vars for a test fleet', async () => {