From fe88e2239d5e9e46a211fea621d75662cceba65c Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 21 Nov 2024 22:36:55 +0000 Subject: [PATCH] DEV: Improve pnpmfile workspace workaround (#29881) Some setups have pnpm installed as `pnpm.cjs`, so the `endsWith` check wasn't working --- .pnpmfile.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 75c353fc8df..0ebc64c2241 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -31,7 +31,9 @@ if ( "> pnpm was run inside a plugin directory. Re-executing with --ignore-workspace..." ); - const indexOfPnpm = process.argv.findIndex((a) => a.endsWith("pnpm")); + const indexOfPnpm = process.argv.findIndex( + (a) => a.includes("/pnpm") || a.endsWith("pnpm") + ); const newArgs = [...process.argv]; newArgs.splice(indexOfPnpm + 1, 0, "--ignore-workspace");