1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
18 | return new (P || (P = Promise))(function (resolve, reject) {
|
19 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
20 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
21 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
22 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
23 | });
|
24 | };
|
25 | Object.defineProperty(exports, "__esModule", { value: true });
|
26 | const automation_client_1 = require("@atomist/automation-client");
|
27 | const commandSearch_1 = require("./support/commandSearch");
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | function listGeneratorsHandler(sdm) {
|
35 | return {
|
36 | listener: createListener(sdm),
|
37 | name: "listGenerators",
|
38 | description: "List generators",
|
39 | intent: ["list generators", "show generators"],
|
40 | };
|
41 | }
|
42 | exports.listGeneratorsHandler = listGeneratorsHandler;
|
43 | function createListener(sdm) {
|
44 | return (cli) => __awaiter(this, void 0, void 0, function* () {
|
45 | const generators = commandSearch_1.commandHandlersWithTag(sdm, "generator");
|
46 | let message = `${generators.length} generators in this software delivery machine\n`;
|
47 | generators.forEach((hi) => __awaiter(this, void 0, void 0, function* () {
|
48 | message += `${hi.instance.intent.map(intent => "`" + intent + "`").join(", ")}\n`;
|
49 | }));
|
50 | yield cli.context.messageClient.respond(message);
|
51 | return automation_client_1.Success;
|
52 | });
|
53 | }
|
54 |
|
\ | No newline at end of file |