1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | function default_1() {
|
11 | return (options, context) => {
|
12 | if (!(options === null || options === void 0 ? void 0 : options.name)) {
|
13 | throw new Error('RunSchematicTask requires an options object with a non-empty name property.');
|
14 | }
|
15 | const maybeWorkflow = context.engine.workflow;
|
16 | const collection = options.collection || context.schematic.collection.description.name;
|
17 | if (!maybeWorkflow) {
|
18 | throw new Error('Need Workflow to support executing schematics as post tasks.');
|
19 | }
|
20 | return maybeWorkflow.execute({
|
21 | collection: collection,
|
22 | schematic: options.name,
|
23 | options: options.options,
|
24 |
|
25 | allowPrivate: collection == context.schematic.collection.description.name,
|
26 | });
|
27 | };
|
28 | }
|
29 | exports.default = default_1;
|