From cdec4a684718ad6cbbce05a474bdbaceb77280e3 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 14:52:59 -0400 Subject: [PATCH] Deprecate `envs` command in favor of `env list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/env/list.ts | 1 + tests/commands/env/list.spec.ts | 9 +++------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index d59ff2fa..911d0dfc 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2188,7 +2188,7 @@ port mapping in the format [:[localIP:]localPort] ### Aliases -- `envs` +- `envs` *(deprecated)* To use one of the aliases, replace `env list` with the alias. diff --git a/src/commands/env/list.ts b/src/commands/env/list.ts index 5a32d97e..875014f4 100644 --- a/src/commands/env/list.ts +++ b/src/commands/env/list.ts @@ -47,6 +47,7 @@ interface ServiceEnvironmentVariableInfo export default class EnvListCmd extends Command { public static aliases = ['envs']; + public static deprecateAliases = true; public static description = stripIndent` List the environment or config variables of a fleet, device or service. diff --git a/tests/commands/env/list.spec.ts b/tests/commands/env/list.spec.ts index 5cf83541..a0790412 100644 --- a/tests/commands/env/list.spec.ts +++ b/tests/commands/env/list.spec.ts @@ -65,20 +65,17 @@ describe('balena env list', function () { api.expectGetAppEnvVars(); api.expectGetAppServiceVars(); - const { out, err } = await runCommand(`envs -f ${appName}`); + const { out } = await runCommand(`envs -f ${appName}`); - expect(out.join('')).to.satisfy((msg: string) => - msg.endsWith( - stripIndent` + expect(out.join('')).to.contain( + stripIndent` ID NAME VALUE FLEET SERVICE 120110 svar1 svar1-value gh_user/testApp service1 120111 svar2 svar2-value gh_user/testApp service2 120101 var1 var1-val gh_user/testApp * 120102 var2 22 gh_user/testApp * ` + '\n', - ), ); - expect(err.join('')).to.equal(''); }); it('should successfully list config vars for a test fleet', async () => {