From a666c8c9f92d87e7a3b4d4e06fdc027b3bf9663e Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sun, 15 Sep 2024 11:29:24 +0530 Subject: [PATCH] fix(cli): `deno task` exit with status 0 (#25637) Fixes https://github.com/denoland/deno/issues/25632 Exit code 1 indiciates some sort of failure but `deno task` (without arguments) is used to list available commands. --------- Co-authored-by: Yoshiya Hinosawa --- cli/tools/task.rs | 2 +- tests/specs/task/both_no_arg/__test__.jsonc | 2 +- .../cwd_resolves_config_from_specified_dir/__test__.jsonc | 2 +- tests/specs/task/doc_comments_no_args/__test__.jsonc | 2 +- tests/specs/task/no_args/__test__.jsonc | 2 +- tests/specs/task/package_json_no_arg/__test__.jsonc | 2 +- tests/specs/task/workspace/__test__.jsonc | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cli/tools/task.rs b/cli/tools/task.rs index cc16bb9a3f..e806d586c6 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -75,7 +75,7 @@ See https://docs.deno.com/go/config"# &cli_options.start_dir, &tasks_config, )?; - return Ok(1); + return Ok(0); } }; diff --git a/tests/specs/task/both_no_arg/__test__.jsonc b/tests/specs/task/both_no_arg/__test__.jsonc index c80db130e9..7f60fcf366 100644 --- a/tests/specs/task/both_no_arg/__test__.jsonc +++ b/tests/specs/task/both_no_arg/__test__.jsonc @@ -4,5 +4,5 @@ "envs": { "NO_COLOR": "1" }, - "exitCode": 1 + "exitCode": 0 } diff --git a/tests/specs/task/cwd_resolves_config_from_specified_dir/__test__.jsonc b/tests/specs/task/cwd_resolves_config_from_specified_dir/__test__.jsonc index 97898e14ff..d8ba8d97f1 100644 --- a/tests/specs/task/cwd_resolves_config_from_specified_dir/__test__.jsonc +++ b/tests/specs/task/cwd_resolves_config_from_specified_dir/__test__.jsonc @@ -4,5 +4,5 @@ "envs": { "NO_COLOR": "1" }, - "exitCode": 1 + "exitCode": 0 } diff --git a/tests/specs/task/doc_comments_no_args/__test__.jsonc b/tests/specs/task/doc_comments_no_args/__test__.jsonc index 2f9db088a6..9843fa5abb 100644 --- a/tests/specs/task/doc_comments_no_args/__test__.jsonc +++ b/tests/specs/task/doc_comments_no_args/__test__.jsonc @@ -2,5 +2,5 @@ "args": "task", "envs": { "NO_COLOR": "1" }, "output": "task.out", - "exitCode": 1 + "exitCode": 0 } diff --git a/tests/specs/task/no_args/__test__.jsonc b/tests/specs/task/no_args/__test__.jsonc index 9ec24d1d21..6347c5989c 100644 --- a/tests/specs/task/no_args/__test__.jsonc +++ b/tests/specs/task/no_args/__test__.jsonc @@ -4,5 +4,5 @@ "envs": { "NO_COLOR": "1" }, - "exitCode": 1 + "exitCode": 0 } diff --git a/tests/specs/task/package_json_no_arg/__test__.jsonc b/tests/specs/task/package_json_no_arg/__test__.jsonc index 2d7b75a2f2..4ee627dd2e 100644 --- a/tests/specs/task/package_json_no_arg/__test__.jsonc +++ b/tests/specs/task/package_json_no_arg/__test__.jsonc @@ -4,5 +4,5 @@ "envs": { "NO_COLOR": "1" }, - "exitCode": 1 + "exitCode": 0 } diff --git a/tests/specs/task/workspace/__test__.jsonc b/tests/specs/task/workspace/__test__.jsonc index b08f35afca..5a3ad1356a 100644 --- a/tests/specs/task/workspace/__test__.jsonc +++ b/tests/specs/task/workspace/__test__.jsonc @@ -3,25 +3,25 @@ "root": { "args": "task", "output": "root.out", - "exitCode": 1 + "exitCode": 0 }, "package_a": { "args": "task", "cwd": "package-a", "output": "package-a.out", - "exitCode": 1 + "exitCode": 0 }, "package_b": { "args": "task", "cwd": "package-b", "output": "package-b.out", - "exitCode": 1 + "exitCode": 0 }, "scripts": { "args": "task", "cwd": "scripts", "output": "scripts.out", - "exitCode": 1 + "exitCode": 0 }, "package_b_tasks": { "steps": [{