DEV: Add --ignore-workspace immediately after 'pnpm' in arguments (#29662)

Adding it to the end means it may get passed to some other tool (e.g. `pnpm eslint` would end up as `pnpm eslint --ignore-workspace`, but we want `pnpm --ignore-workspace eslint`)
This commit is contained in:
David Taylor 2024-11-08 17:54:22 +00:00 committed by GitHub
parent cb4b8146a3
commit 698571e24b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,14 +31,14 @@ if (
"> pnpm was run inside a plugin directory. Re-executing with --ignore-workspace..."
);
const indexOfPnpm = process.argv.findIndex((a) => a.endsWith("pnpm"));
const newArgs = [...process.argv];
newArgs.splice(indexOfPnpm + 1, 0, "--ignore-workspace");
try {
execFileSync(
process.argv[0],
[...process.argv.slice(1), "--ignore-workspace"],
{
stdio: "inherit",
}
);
execFileSync(newArgs[0], newArgs.slice(1), {
stdio: "inherit",
});
} catch (e) {
if (e.status) {
process.exit(e.status);