UNPKG

@catladder/cli

Version:

Panter cli tool for cloud CI/CD and DevOps

32 lines (31 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.commandEnvVars = void 0; const defineCommand_1 = require("../../core/defineCommand"); const getProjectConfig_1 = require("../../config/getProjectConfig"); const autocompletions_1 = require("../../apps/cli/commands/project/utils/autocompletions"); exports.commandEnvVars = (0, defineCommand_1.defineCommand)({ name: "project env-vars", description: "list env vars", group: "project", inputs: { envComponent: { type: "string", message: "environment:component", positional: true, choices: async () => (0, autocompletions_1.envAndComponents)() } }, execute: async ctx => { const envComponent = await ctx.get("envComponent"); const { env, componentName } = (0, getProjectConfig_1.parseChoice)(envComponent); // Pass ctx as the logger (IO satisfies LoggerCmdInstance) const envvars = await (0, getProjectConfig_1.getEnvVarsResolved)(ctx, env, componentName); Object.keys(envvars).forEach(key => ctx.log(`${key}: ${envvars[key]}`)); } });