get-project.js 856 B

1234567891011121314151617181920212223
  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. const schematics_1 = require("@angular-devkit/schematics");
  11. /**
  12. * Finds the specified project configuration in the workspace. Throws an error if the project
  13. * couldn't be found.
  14. */
  15. function getProjectFromWorkspace(workspace, projectName) {
  16. const project = workspace.projects[projectName || workspace.defaultProject];
  17. if (!project) {
  18. throw new schematics_1.SchematicsException(`Could not find project in workspace: ${projectName}`);
  19. }
  20. return project;
  21. }
  22. exports.getProjectFromWorkspace = getProjectFromWorkspace;
  23. //# sourceMappingURL=get-project.js.map