Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
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 | // Allow private when calling from the same collection.
|
---|
25 | allowPrivate: collection == context.schematic.collection.description.name,
|
---|
26 | });
|
---|
27 | };
|
---|
28 | }
|
---|
29 | exports.default = default_1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.