mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
parent
cb4b8146a3
commit
698571e24b
@ -31,14 +31,14 @@ if (
|
|||||||
"> pnpm was run inside a plugin directory. Re-executing with --ignore-workspace..."
|
"> 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 {
|
try {
|
||||||
execFileSync(
|
execFileSync(newArgs[0], newArgs.slice(1), {
|
||||||
process.argv[0],
|
stdio: "inherit",
|
||||||
[...process.argv.slice(1), "--ignore-workspace"],
|
});
|
||||||
{
|
|
||||||
stdio: "inherit",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.status) {
|
if (e.status) {
|
||||||
process.exit(e.status);
|
process.exit(e.status);
|
||||||
|
Loading…
Reference in New Issue
Block a user