@kui-shell/plugin-tekton
Version:
Visualizations for Tekton Pipelines
35 lines • 1.61 kB
JavaScript
;
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 flow_1 = require("../view/flow");
const read_1 = require("../lib/read");
const usage = {
command: 'flow',
strict: 'flow',
docs: 'Preview a Tekton pipeline',
required: [
{
name: 'pipeline.yml',
file: true,
docs: 'path to a pipeline description file'
}
]
};
exports.default = (commandTree) => {
commandTree.listen('/tekton/flow', ({ argvNoOptions, tab }) => __awaiter(void 0, void 0, void 0, function* () {
const filepath = argvNoOptions[argvNoOptions.indexOf('flow') + 1];
const raw = yield read_1.read(tab, filepath);
const jsons = yield read_1.parse(raw);
const runs = undefined;
return flow_1.default(tab, jsons, runs, raw, filepath);
}), { usage, noAuthOk: true, inBrowserOk: true });
};
//# sourceMappingURL=preview.js.map