UNPKG

kui-shell

Version:

This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool

37 lines 1.78 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const i18n_1 = require("@kui-shell/core/api/i18n"); const version_1 = require("./version"); const strings = i18n_1.i18n('plugin-manager'); const doGet = ({ argvNoOptions }) => __awaiter(void 0, void 0, void 0, function* () { argvNoOptions = argvNoOptions.slice(argvNoOptions.indexOf('get') + 1); const name = argvNoOptions.shift(); const { installedOn, version } = yield version_1.getVersion(name); const response = { kind: 'plugin', metadata: { name }, version, toolbarText: { type: 'info', text: strings('Installed on', installedOn.toLocaleString()) }, modes: [{ mode: 'commands', content: `plugin commands ${name}`, contentType: 'command' }], buttons: [{ mode: 'uninstall', label: 'Remove', command: `confirm "plugin remove ${name}"`, kind: 'drilldown' }] }; return response; }); exports.default = (commandTree) => { commandTree.listen('/plugin/get', doGet); }; //# sourceMappingURL=get.js.map