UNPKG

801 BJavaScriptView Raw
1"use strict";
2exports.__esModule = true;
3exports.getWorkspace = exports.getWorkspacePath = void 0;
4var schematics_1 = require("@angular-devkit/schematics");
5function 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}
10exports.getWorkspacePath = getWorkspacePath;
11function 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 (" + path + ")");
16 }
17 var config = configBuffer.toString();
18 return JSON.parse(config);
19}
20exports.getWorkspace = getWorkspace;
21//# sourceMappingURL=config.js.map
\No newline at end of file