Skip to content
Prev Previous commit
Next Next commit
Fixes broken plugin tests
  • Loading branch information
arcanis committed Mar 29, 2022
commit 6f1b3d3e67433daddaf1d237a7edd6bcb855da5a
12 changes: 7 additions & 5 deletions packages/yarnpkg-cli/sources/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ export async function main({binaryVersion, pluginConfiguration}: {binaryVersion:
});

const isSameBinary = async () =>
yarnPath === selfPath ||
Buffer.compare(...await Promise.all([
tryRead(yarnPath),
tryRead(selfPath),
])) === 0;
yarnPath && (
yarnPath === selfPath ||
Buffer.compare(...await Promise.all([
tryRead(yarnPath),
tryRead(selfPath),
])) === 0
);

// Avoid unnecessary spawn when run directly
if (!ignorePath && !ignoreCwd && await isSameBinary()) {
Expand Down