mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(child_process): map node --no-warnings
flag to --quiet
(#26288)
Closes https://github.com/denoland/deno/issues/25899
This commit is contained in:
parent
4385020d14
commit
f7dba52133
3 changed files with 24 additions and 2 deletions
|
@ -132,6 +132,8 @@ export function fork(
|
||||||
rm = 2;
|
rm = 2;
|
||||||
}
|
}
|
||||||
execArgv.splice(index, rm);
|
execArgv.splice(index, rm);
|
||||||
|
} else if (flag.startsWith("--no-warnings")) {
|
||||||
|
execArgv[index] = "--quiet";
|
||||||
} else {
|
} else {
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1191,8 +1191,12 @@ function toDenoArgs(args: string[]): string[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flagInfo === undefined) {
|
if (flagInfo === undefined) {
|
||||||
// Not a known flag that expects a value. Just copy it to the output.
|
if (arg === "--no-warnings") {
|
||||||
denoArgs.push(arg);
|
denoArgs.push("--quiet");
|
||||||
|
} else {
|
||||||
|
// Not a known flag that expects a value. Just copy it to the output.
|
||||||
|
denoArgs.push(arg);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1045,3 +1045,19 @@ Deno.test(async function sendAfterClosedThrows() {
|
||||||
|
|
||||||
await timeout.promise;
|
await timeout.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test(async function noWarningsFlag() {
|
||||||
|
const code = ``;
|
||||||
|
const file = await Deno.makeTempFile();
|
||||||
|
await Deno.writeTextFile(file, code);
|
||||||
|
const timeout = withTimeout<void>();
|
||||||
|
const child = CP.fork(file, [], {
|
||||||
|
execArgv: ["--no-warnings"],
|
||||||
|
stdio: ["inherit", "inherit", "inherit", "ipc"],
|
||||||
|
});
|
||||||
|
child.on("close", () => {
|
||||||
|
timeout.resolve();
|
||||||
|
});
|
||||||
|
|
||||||
|
await timeout.promise;
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue