UNPKG

926 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.moveProject = void 0;
4const devkit_1 = require("@nrwl/devkit");
5const path_1 = require("path");
6/**
7 * Moves a project to the given destination path
8 *
9 * @param schema The options provided to the schematic
10 */
11function moveProject(tree, schema, project) {
12 (0, devkit_1.visitNotIgnoredFiles)(tree, project.root, (file) => {
13 // This is a rename but Angular Devkit isn't capable of writing to a file after it's renamed so this is a workaround
14 const content = tree.read(file);
15 const relativeFromOriginalSource = (0, path_1.relative)(project.root, file);
16 const newFilePath = (0, path_1.join)(schema.relativeToRootDestination, relativeFromOriginalSource);
17 tree.write(newFilePath, content);
18 tree.delete(file);
19 });
20}
21exports.moveProject = moveProject;
22//# sourceMappingURL=move-project.js.map
\No newline at end of file