1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const config_1 = require("@schematics/angular/utility/config");
|
4 | function getWorkspacePath(host) {
|
5 | return config_1.getWorkspacePath(host);
|
6 | }
|
7 | exports.getWorkspacePath = getWorkspacePath;
|
8 | function getWorkspace(host) {
|
9 | return config_1.getWorkspace(host);
|
10 | }
|
11 | exports.getWorkspace = getWorkspace;
|
12 | function addProjectToWorkspace(workspace, name, project) {
|
13 | return (host, context) => {
|
14 | if (workspace.projects[name]) {
|
15 | throw new Error(`Project '${name}' already exists in workspace.`);
|
16 | }
|
17 |
|
18 | workspace.projects[name] = project;
|
19 | if (!workspace.defaultProject && Object.keys(workspace.projects).length === 1) {
|
20 |
|
21 | workspace.defaultProject = name;
|
22 | }
|
23 | return updateWorkspace(workspace);
|
24 | };
|
25 | }
|
26 | exports.addProjectToWorkspace = addProjectToWorkspace;
|
27 | function updateWorkspace(workspace) {
|
28 | return config_1.updateWorkspace(workspace);
|
29 | }
|
30 | exports.updateWorkspace = updateWorkspace;
|
31 | exports.configPath = config_1.configPath;
|
32 | function getConfig(host) {
|
33 | return config_1.getConfig(host);
|
34 | }
|
35 | exports.getConfig = getConfig;
|
36 | function getAppFromConfig(config, appIndexOrName) {
|
37 | return config_1.getAppFromConfig(config, appIndexOrName);
|
38 | }
|
39 | exports.getAppFromConfig = getAppFromConfig;
|
40 |
|
\ | No newline at end of file |