Skip to content

Commit

Permalink
fix(devkit): normalizing paths when moving files (#6877)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Aug 27, 2021
1 parent 9c07d7f commit 12ed2d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/devkit/src/utils/move-dir.ts
@@ -1,11 +1,14 @@
import { Tree } from '@nrwl/tao/src/shared/tree';
import { visitNotIgnoredFiles } from '../generators/visit-not-ignored-files';
import { normalizePath } from './path';

export function moveFilesToNewDirectory(
tree: Tree,
oldDir: string,
newDir: string
): void {
oldDir = normalizePath(oldDir);
newDir = normalizePath(newDir);
visitNotIgnoredFiles(tree, oldDir, (file) => {
try {
tree.rename(file, file.replace(oldDir, newDir));
Expand Down

0 comments on commit 12ed2d3

Please sign in to comment.