From d7ef05239f0949d1b9a7ba9ad700d8b514cc21d4 Mon Sep 17 00:00:00 2001 From: Sebastian Vallin <29126461+Sebbev@users.noreply.github.com> Date: Wed, 17 Sep 2025 16:25:36 +0200 Subject: [PATCH] feat: Add environment selection for env pull and push commands --- src/commands/env/pull.ts | 16 ++++++++++++++-- src/commands/env/push.ts | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/commands/env/pull.ts b/src/commands/env/pull.ts index bddbec7..c89793e 100644 --- a/src/commands/env/pull.ts +++ b/src/commands/env/pull.ts @@ -53,12 +53,24 @@ export default class EnvPull extends Command { const projectId = project.projectId; const projectSelected = await getProject(projectId, auth, this); + const {environment} = await inquirer.prompt([ + { + choices: projectSelected.environments.map((environment: any) => ({ + name: environment.name, + value: environment, + })), + message: "Select the environment:", + name: "environment", + type: "list", + }, + ]); + const choices = [ - ...projectSelected.applications.map((app: any) => ({ + ...environment.applications.map((app: any) => ({ name: `${app.name} (Application)`, value: app.env, })), - ...projectSelected.compose.map((compose: any) => ({ + ...environment.compose.map((compose: any) => ({ name: `${compose.name} (Compose)`, value: compose.env, })), diff --git a/src/commands/env/push.ts b/src/commands/env/push.ts index 4a337fa..0870bfd 100644 --- a/src/commands/env/push.ts +++ b/src/commands/env/push.ts @@ -59,12 +59,24 @@ export default class EnvPush extends Command { const projectId = project.projectId; const projectSelected = await getProject(projectId, auth, this); + const {environment} = await inquirer.prompt([ + { + choices: projectSelected.environments.map((environment: any) => ({ + name: environment.name, + value: environment, + })), + message: "Select the environment:", + name: "environment", + type: "list", + }, + ]); + const choices = [ - ...projectSelected.applications.map((app: any) => ({ + ...environment.applications.map((app: any) => ({ name: `${app.name} (Application)`, value: {serviceType: 'app', service: app}, })), - ...projectSelected.compose.map((compose: any) => ({ + ...environment.compose.map((compose: any) => ({ name: `${compose.name} (Compose)`, value: {serviceType: 'compose', service: compose} })),