1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.getWorkspace = exports.getWorkspacePath = void 0;
|
4 | var schematics_1 = require("@angular-devkit/schematics");
|
5 | function getWorkspacePath(host) {
|
6 | var possibleFiles = ['/angular.json', '/.angular.json', '/workspace.json'];
|
7 | var path = possibleFiles.filter(function (path) { return host.exists(path); })[0];
|
8 | return path;
|
9 | }
|
10 | exports.getWorkspacePath = getWorkspacePath;
|
11 | function getWorkspace(host) {
|
12 | var path = getWorkspacePath(host);
|
13 | var configBuffer = host.read(path);
|
14 | if (configBuffer === null) {
|
15 | throw new schematics_1.SchematicsException("Could not find (".concat(path, ")"));
|
16 | }
|
17 | var config = configBuffer.toString();
|
18 | return JSON.parse(config);
|
19 | }
|
20 | exports.getWorkspace = getWorkspace;
|
21 |
|
\ | No newline at end of file |