@nrwl/workspace
Version:
17 lines • 935 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProjectConfigurationInNewDestination = void 0;
const devkit_1 = require("@nrwl/devkit");
function createProjectConfigurationInNewDestination(tree, schema, projectConfig) {
if (projectConfig.name) {
projectConfig.name = schema.newProjectName;
}
// replace old root path with new one
const projectString = JSON.stringify(projectConfig);
const newProjectString = projectString.replace(new RegExp(projectConfig.root, 'g'), schema.relativeToRootDestination);
const newProject = JSON.parse(newProjectString);
// Create a new project with the root replaced
(0, devkit_1.addProjectConfiguration)(tree, schema.newProjectName, newProject);
}
exports.createProjectConfigurationInNewDestination = createProjectConfigurationInNewDestination;
//# sourceMappingURL=create-project-configuration-in-new-destination.js.map
;