Skip to content

Commit

Permalink
feat(docker-build): Resolve patch path with parentLocator
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Sep 11, 2020
1 parent bad3d97 commit 15b2549
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/docker-build/src/utils/copyPatchFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export default async function copyPatchFiles({
for (const descriptor of ws.dependencies.values()) {
if (!descriptor.range.startsWith('patch:')) continue;

const { patchPaths } = patchUtils.parseDescriptor(descriptor);
const { parentLocator, patchPaths } = patchUtils.parseDescriptor(
descriptor,
);

for (const path of patchPaths) {
// Ignore builtin modules
Expand All @@ -27,7 +29,10 @@ export default async function copyPatchFiles({
// TODO: Handle absolute path
if (ppath.isAbsolute(path)) continue;

const src = ppath.join(ws.relativeCwd, path);
if (!parentLocator) continue;

const parentWorkspace = ws.project.getWorkspaceByLocator(parentLocator);
const src = ppath.join(parentWorkspace.relativeCwd, path);
const dest = ppath.join(destination, src);

report.reportInfo(null, src);
Expand Down

0 comments on commit 15b2549

Please sign in to comment.