UNPKG

995 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.setDefaultCollection = void 0;
4const workspace_1 = require("../workspace");
5/**
6 * Sets the default collection to the provided collection name
7 * The collection name is only set in case the current defaultCollection is undefined or set to '@nrwl/workspace'
8 * @param collectionName Name of the collection to be set as defaultCollection
9 */
10function setDefaultCollection(collectionName) {
11 return (0, workspace_1.updateWorkspace)((workspace) => {
12 workspace.extensions.cli = workspace.extensions.cli || {};
13 const defaultCollection = workspace.extensions.cli &&
14 workspace.extensions.cli.defaultCollection;
15 if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
16 workspace.extensions.cli.defaultCollection =
17 collectionName;
18 }
19 });
20}
21exports.setDefaultCollection = setDefaultCollection;
22//# sourceMappingURL=workspace.js.map
\No newline at end of file