From b3f1f3ba04e51554ab59d6255bf34a79a9c42bd0 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 6 Aug 2024 20:35:30 +0530 Subject: feat: deno run (#24891) This PR updates `deno run` to fallback to executing tasks when there is no script with the specified name. If there are both script and a task with the same name then `deno run` will prioritise executing the script. --- tests/specs/run/run_task/__test__.jsonc | 13 +++++++++++++ tests/specs/run/run_task/deno.json | 5 +++++ tests/specs/run/run_task/main.out | 2 ++ tests/specs/run/run_task/main.ts | 1 + tests/specs/run/run_task/not_found.out | 1 + 5 files changed, 22 insertions(+) create mode 100644 tests/specs/run/run_task/__test__.jsonc create mode 100644 tests/specs/run/run_task/deno.json create mode 100644 tests/specs/run/run_task/main.out create mode 100644 tests/specs/run/run_task/main.ts create mode 100644 tests/specs/run/run_task/not_found.out (limited to 'tests') diff --git a/tests/specs/run/run_task/__test__.jsonc b/tests/specs/run/run_task/__test__.jsonc new file mode 100644 index 000000000..0d1c82efd --- /dev/null +++ b/tests/specs/run/run_task/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tests": { + "deno_run_task": { + "args": "run main", + "output": "main.out" + }, + "deno_run_module_task_not_found": { + "args": "run not_found", + "output": "not_found.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/run/run_task/deno.json b/tests/specs/run/run_task/deno.json new file mode 100644 index 000000000..54772504e --- /dev/null +++ b/tests/specs/run/run_task/deno.json @@ -0,0 +1,5 @@ +{ + "tasks": { + "main": "deno run main.ts" + } +} diff --git a/tests/specs/run/run_task/main.out b/tests/specs/run/run_task/main.out new file mode 100644 index 000000000..f946c4a79 --- /dev/null +++ b/tests/specs/run/run_task/main.out @@ -0,0 +1,2 @@ +Task main deno run main.ts +main diff --git a/tests/specs/run/run_task/main.ts b/tests/specs/run/run_task/main.ts new file mode 100644 index 000000000..6c2ee34f3 --- /dev/null +++ b/tests/specs/run/run_task/main.ts @@ -0,0 +1 @@ +console.log("main"); diff --git a/tests/specs/run/run_task/not_found.out b/tests/specs/run/run_task/not_found.out new file mode 100644 index 000000000..5d3bba059 --- /dev/null +++ b/tests/specs/run/run_task/not_found.out @@ -0,0 +1 @@ +error: Module not found "file:///[WILDCARD]/not_found". -- cgit v1.2.3