UNPKG

1.2 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.runCommandsSchematic = exports.runCommandsGenerator = void 0;
4const tslib_1 = require("tslib");
5const devkit_1 = require("@nrwl/devkit");
6function runCommandsGenerator(host, schema) {
7 return tslib_1.__awaiter(this, void 0, void 0, function* () {
8 const project = (0, devkit_1.readProjectConfiguration)(host, schema.project);
9 project.targets = project.targets || {};
10 project.targets[schema.name] = {
11 executor: 'nx:run-commands',
12 outputs: schema.outputs
13 ? schema.outputs.split(',').map((s) => s.trim())
14 : [],
15 options: {
16 command: schema.command,
17 cwd: schema.cwd,
18 envFile: schema.envFile,
19 },
20 };
21 (0, devkit_1.updateProjectConfiguration)(host, schema.project, project);
22 yield (0, devkit_1.formatFiles)(host);
23 });
24}
25exports.runCommandsGenerator = runCommandsGenerator;
26exports.default = runCommandsGenerator;
27exports.runCommandsSchematic = (0, devkit_1.convertNxGenerator)(runCommandsGenerator);
28//# sourceMappingURL=run-commands.js.map
\No newline at end of file