fix(devkit): move files to a directory using normalized paths to handle windows correctly (#7264)
This commit is contained in:
parent
3881d002fe
commit
c21835d40a
@ -1,4 +1,5 @@
|
||||
import { Tree } from '@nrwl/tao/src/shared/tree';
|
||||
import { relative } from 'path';
|
||||
import { visitNotIgnoredFiles } from '../generators/visit-not-ignored-files';
|
||||
import { normalizePath } from './path';
|
||||
|
||||
@ -11,7 +12,7 @@ export function moveFilesToNewDirectory(
|
||||
newDir = normalizePath(newDir);
|
||||
visitNotIgnoredFiles(tree, oldDir, (file) => {
|
||||
try {
|
||||
tree.rename(file, file.replace(oldDir, newDir));
|
||||
tree.rename(file, `${newDir}/${relative(oldDir, file)}`);
|
||||
} catch (e) {
|
||||
if (!tree.exists(oldDir)) {
|
||||
console.warn(`Path ${oldDir} does not exist`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user