diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-05-04 13:03:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 13:03:30 +0200 |
commit | a913b7a1ba67849464d0314eee9851f59c22556b (patch) | |
tree | 0e394ce772dacda117acf541339f13e62a997b19 /std/examples | |
parent | bd3b9cc7d97700ee627a621f561eda4c20dbd5f3 (diff) |
BREAKING: remove CLI 'deno script.ts' hack (#5026)
This PR removes the hack in CLI that allows to run scripts with shorthand: deno script.ts.
Removing this functionality because it hacks around short-comings of clap our CLI parser. We agree that this shorthand syntax is desirable, but it needs to be rethinked and reimplemented. For 1.0 we should go with conservative approach that is correct.
Diffstat (limited to 'std/examples')
-rw-r--r-- | std/examples/chat/server_test.ts | 1 | ||||
-rw-r--r-- | std/examples/tests/cat_test.ts | 1 | ||||
-rw-r--r-- | std/examples/tests/catj_test.ts | 2 | ||||
-rw-r--r-- | std/examples/tests/colors_test.ts | 2 | ||||
-rw-r--r-- | std/examples/tests/curl_test.ts | 8 | ||||
-rw-r--r-- | std/examples/tests/echo_server_test.ts | 2 | ||||
-rw-r--r-- | std/examples/tests/welcome_test.ts | 2 | ||||
-rw-r--r-- | std/examples/tests/xeval_test.ts | 4 |
8 files changed, 15 insertions, 7 deletions
diff --git a/std/examples/chat/server_test.ts b/std/examples/chat/server_test.ts index 76b1f1bf5..d1c1a8afa 100644 --- a/std/examples/chat/server_test.ts +++ b/std/examples/chat/server_test.ts @@ -12,6 +12,7 @@ async function startServer(): Promise<Deno.Process> { // TODO(lucacasonato): remove unstable once possible cmd: [ Deno.execPath(), + "run", "--allow-net", "--allow-read", "--unstable", diff --git a/std/examples/tests/cat_test.ts b/std/examples/tests/cat_test.ts index b12a6916f..4633c5750 100644 --- a/std/examples/tests/cat_test.ts +++ b/std/examples/tests/cat_test.ts @@ -6,6 +6,7 @@ Deno.test("[examples/cat] print multiple files", async () => { const process = Deno.run({ cmd: [ Deno.execPath(), + "run", "--allow-read", "cat.ts", "testdata/cat/hello.txt", diff --git a/std/examples/tests/catj_test.ts b/std/examples/tests/catj_test.ts index 53b36bef8..c3eb61f51 100644 --- a/std/examples/tests/catj_test.ts +++ b/std/examples/tests/catj_test.ts @@ -77,7 +77,7 @@ Deno.test("[examples/catj] read from stdin", async () => { function catj(...files: string[]): Deno.Process { return Deno.run({ - cmd: [Deno.execPath(), "--allow-read", "catj.ts", ...files], + cmd: [Deno.execPath(), "run", "--allow-read", "catj.ts", ...files], cwd: "examples", stdin: "piped", stdout: "piped", diff --git a/std/examples/tests/colors_test.ts b/std/examples/tests/colors_test.ts index ac779adb8..90c469c00 100644 --- a/std/examples/tests/colors_test.ts +++ b/std/examples/tests/colors_test.ts @@ -4,7 +4,7 @@ import { assertStrictEq } from "../../testing/asserts.ts"; Deno.test("[examples/colors] print a colored text", async () => { const decoder = new TextDecoder(); const process = Deno.run({ - cmd: [Deno.execPath(), "colors.ts"], + cmd: [Deno.execPath(), "run", "colors.ts"], cwd: "examples", stdout: "piped", }); diff --git a/std/examples/tests/curl_test.ts b/std/examples/tests/curl_test.ts index 9b2870216..69e0e52d6 100644 --- a/std/examples/tests/curl_test.ts +++ b/std/examples/tests/curl_test.ts @@ -14,7 +14,13 @@ Deno.test({ const decoder = new TextDecoder(); const process = Deno.run({ - cmd: [Deno.execPath(), "--allow-net", "curl.ts", "http://localhost:8081"], + cmd: [ + Deno.execPath(), + "run", + "--allow-net", + "curl.ts", + "http://localhost:8081", + ], cwd: "examples", stdout: "piped", }); diff --git a/std/examples/tests/echo_server_test.ts b/std/examples/tests/echo_server_test.ts index 9c413d737..3e6096190 100644 --- a/std/examples/tests/echo_server_test.ts +++ b/std/examples/tests/echo_server_test.ts @@ -6,7 +6,7 @@ Deno.test("[examples/echo_server]", async () => { const encoder = new TextEncoder(); const decoder = new TextDecoder(); const process = Deno.run({ - cmd: [Deno.execPath(), "--allow-net", "echo_server.ts"], + cmd: [Deno.execPath(), "run", "--allow-net", "echo_server.ts"], cwd: "examples", stdout: "piped", }); diff --git a/std/examples/tests/welcome_test.ts b/std/examples/tests/welcome_test.ts index cacb77ab9..d508773c5 100644 --- a/std/examples/tests/welcome_test.ts +++ b/std/examples/tests/welcome_test.ts @@ -4,7 +4,7 @@ import { assertStrictEq } from "../../testing/asserts.ts"; Deno.test("[examples/welcome] print a welcome message", async () => { const decoder = new TextDecoder(); const process = Deno.run({ - cmd: [Deno.execPath(), "welcome.ts"], + cmd: [Deno.execPath(), "run", "welcome.ts"], cwd: "examples", stdout: "piped", }); diff --git a/std/examples/tests/xeval_test.ts b/std/examples/tests/xeval_test.ts index 426f6fe56..eeeac7731 100644 --- a/std/examples/tests/xeval_test.ts +++ b/std/examples/tests/xeval_test.ts @@ -29,7 +29,7 @@ Deno.test({ name: "xevalCliReplvar", fn: async function (): Promise<void> { const p = run({ - cmd: [execPath(), xevalPath, "--replvar=abc", "console.log(abc)"], + cmd: [execPath(), "run", xevalPath, "--replvar=abc", "console.log(abc)"], stdin: "piped", stdout: "piped", stderr: "null", @@ -45,7 +45,7 @@ Deno.test({ Deno.test("xevalCliSyntaxError", async function (): Promise<void> { const p = run({ - cmd: [execPath(), xevalPath, "("], + cmd: [execPath(), "run", xevalPath, "("], stdin: "null", stdout: "piped", stderr: "piped", |