UNPKG

@catladder/cli

Version:

Panter cli tool for cloud CI/CD and DevOps

36 lines (35 loc) 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.commandConfigSecrets = void 0; const defineCommand_1 = require("../../core/defineCommand"); const commandConfigSecrets_1 = require("../../apps/cli/commands/project/commandConfigSecrets"); const autocompletions_1 = require("../../apps/cli/commands/project/utils/autocompletions"); // This command delegates to the existing implementation which uses // editAsFile (opens editor) and has retry loops with confirm prompts. // Full migration to CommandIO would require reworking the editor flow, // so for now we bridge it. exports.commandConfigSecrets = (0, defineCommand_1.defineCommand)({ name: "project config-secrets", description: "setup/update secrets stored in pass", group: "project", inputs: { envComponent: { type: "string", message: "environment:component", positional: true, required: false, choices: async () => (0, autocompletions_1.envAndComponents)() } }, execute: async ctx => { const envComponent = await ctx.get("envComponent"); // Bridge: the existing implementation accepts CommandInstance-like // objects for logging and prompting. Since it uses this.prompt() // internally (not ctx.prompt), we pass ctx which satisfies the // IO interface for logging. The interactive prompts inside // projectConfigSecrets will need a deeper migration later. await (0, commandConfigSecrets_1.projectConfigSecrets)(ctx, envComponent); } });