From 6fbd95630a7cf04de5e1179b3d41f8f769fa897c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 18 Oct 2022 08:23:53 -0400 Subject: [PATCH] feat(unstable/task): fail task on async command failure (#16301) Tests and implementation are found here: https://github.com/denoland/deno_task_shell/pull/59 This is a breaking change, but `deno task` is unstable. > This changes async commands so that on non-zero exit code they will fail the entire task. For example: > > ```jsonc > // task that asynchronously starts a server and starts a watcher for the frontend > "dev": "deno task server & deno task frontend:watch" > ``` > > Previously when running `deno task dev`, if `deno task server` failed, the entire command would not fail, which kept in line with `sh`, but it's not very practical. This change causes `deno task dev` to fail. > > To opt out, developers can add an `|| exit 0`: > > ```jsonc > "dev": "deno task server || exit 0 & deno task frontend:watch" > ``` --- Cargo.lock | 5 +++-- cli/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89f16cd11c..4e7382f0fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1229,9 +1229,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91059ae4dccefd55b84e0582683fe41e78b4287a2fe283962ea0a1698ea43d4d" +checksum = "9e4e1c86712e2cded9046ac6748cbe5dba87042f045265a51b1ac2629a7fa6c5" dependencies = [ "anyhow", "futures", @@ -1239,6 +1239,7 @@ dependencies = [ "os_pipe", "path-dedot", "tokio", + "tokio-util", ] [[package]] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0c4fcb6f7c..c22de3dbd0 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -57,7 +57,7 @@ deno_emit = "0.9.0" deno_graph = "0.34.0" deno_lint = { version = "0.33.0", features = ["docs"] } deno_runtime = { version = "0.81.0", path = "../runtime" } -deno_task_shell = "0.5.2" +deno_task_shell = "0.6.0" napi_sym = { path = "./napi_sym", version = "0.3.0" } atty = "=0.2.14"