Skip to content

Commit

Permalink
Merge pull request #5 from Dcard/fix-patch-virtual-descriptor
Browse files Browse the repository at this point in the history
fix(docker-build): Resolve virtual descriptors
  • Loading branch information
tommy351 authored Jan 28, 2021
2 parents 6d79056 + 14b77a6 commit 0ff0388
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 0ff0388

Please sign in to comment.