@kui-shell/plugin-tekton
Version:
Visualizations for Tekton Pipelines
33 lines • 1.51 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());
});
};
import flowView from '../view/flow';
import { parse, read } from '../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'
}
]
};
export 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(tab, filepath);
const jsons = yield parse(raw);
const runs = undefined;
return flowView(tab, jsons, runs, raw, filepath);
}), { usage, noAuthOk: true, inBrowserOk: true });
};
//# sourceMappingURL=preview.js.map