From 3c8865455243c91105ab309de973d68c9db349d4 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 27 Nov 2023 17:51:00 -0500 Subject: chore: temp fix for tools/format.js (#21360) --- cli/Cargo.toml | 2 +- tools/format.js | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index e56f53a02..bcdd64187 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -82,9 +82,9 @@ data-url.workspace = true dissimilar = "=1.0.4" dotenvy = "0.15.7" dprint-plugin-json = "=0.19.1" +dprint-plugin-jupyter = "=0.1.1" dprint-plugin-markdown = "=0.16.3" dprint-plugin-typescript = "=0.88.5" -dprint-plugin-jupyter = "=0.1.1" encoding_rs.workspace = true env_logger = "=0.10.0" fancy-regex = "=0.10.0" diff --git a/tools/format.js b/tools/format.js index aff07702b..98da6662b 100755 --- a/tools/format.js +++ b/tools/format.js @@ -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); +} -- cgit v1.2.3