Skip to content

Commit

Permalink
fix(docker-build): Resolve virtual descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Jan 28, 2021
1 parent 6d79056 commit 14b77a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/docker-build/src/utils/copyPatchFiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Report, Workspace } from '@yarnpkg/core';
import { Report, structUtils, Workspace } from '@yarnpkg/core';
import { PortablePath, ppath, xfs } from '@yarnpkg/fslib';
import { patchUtils } from '@yarnpkg/plugin-patch';

Expand All @@ -18,10 +18,14 @@ export default async function copyPatchFiles({

for (const ws of workspaces) {
for (const descriptor of ws.dependencies.values()) {
if (!descriptor.range.startsWith('patch:')) continue;
const patchDescriptor = structUtils.isVirtualDescriptor(descriptor)
? structUtils.devirtualizeDescriptor(descriptor)
: descriptor;

if (!patchDescriptor.range.startsWith('patch:')) continue;

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

for (const path of patchPaths) {
Expand Down

0 comments on commit 14b77a6

Please sign in to comment.