chore: temp fix for tools/format.js (#21360)

This commit is contained in:
David Sherret 2023-11-27 17:51:00 -05:00 committed by GitHub
parent 537e0320f0
commit 3c88654552
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -14,9 +14,17 @@ const cmd = new Deno.Command("deno", {
"--config=" + configFile,
],
cwd: ROOT_PATH,
stdout: "inherit",
stdout: "piped",
stderr: "inherit",
});
const { code } = await cmd.output();
Deno.exit(code);
const { code, stdout } = await cmd.output();
// todo(dsherret): temporary until https://github.com/denoland/deno/pull/21359 gets released.
// Once it's released, just have stdout be inherited above and do `Deno.exit(code)` here.
const stdoutText = new TextDecoder().decode(stdout);
console.log(stdoutText);
if (stdoutText.length > 0) {
Deno.exit(20);
} else {
Deno.exit(code);
}