DEV: Improve pnpmfile workspace workaround (#29881)

Some setups have pnpm installed as `pnpm.cjs`, so the `endsWith` check wasn't working
This commit is contained in:
David Taylor 2024-11-21 22:36:55 +00:00 committed by GitHub
parent 250a145361
commit fe88e2239d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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");