Skip to content

Commit

Permalink
Update: Better comment around symlinks and workspaces (#3672)
Browse files Browse the repository at this point in the history
  • Loading branch information
bestander authored and BYK committed Jun 19, 2017
1 parent b92c19a commit f78fecc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/package-linker.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,12 @@ export default class PackageLinker {
}
}

// fs copy can't copy through a symlink, so we replace those with real paths to workpsaces
for (const [symlink, realpath] of symlinkPaths.entries()) {
if (dest.indexOf(symlink + path.sep) === 0) {
// after hoisting we end up with this structure
// root/node_modules/workspace-package(symlink)/node_modules/package-a
// fs.copy operations can't copy files through a symlink, so all the paths under workspace-package
// need to be replaced with a real path, except for the symlink root/node_modules/workspace-package
dest = dest.replace(symlink, realpath);
}
}
Expand Down

0 comments on commit f78fecc

Please sign in to comment.