Skip to content

Commit

Permalink
refactor: use Deno.execPath where possible (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored and ry committed Jul 29, 2019
1 parent 826deb1 commit 287b0a9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion examples/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ test(function t2(): void {
/** A more complicated test that runs a subprocess. */
test(async function catSmoke(): Promise<void> {
const p = run({
args: ["deno", "run", "--allow-read", "examples/cat.ts", "README.md"],
args: [
Deno.execPath,
"run",
"--allow-read",
"examples/cat.ts",
"README.md"
],
stdout: "piped"
});
const s = await p.status();
Expand Down
2 changes: 1 addition & 1 deletion http/file_server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let fileServer: Deno.Process;
async function startFileServer(): Promise<void> {
fileServer = run({
args: [
"deno",
Deno.execPath,
"run",
"--allow-read",
"--allow-net",
Expand Down
2 changes: 1 addition & 1 deletion http/racing_server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TextProtoReader } from "../textproto/mod.ts";
let server: Deno.Process;
async function startServer(): Promise<void> {
server = run({
args: ["deno", "run", "-A", "http/racing_server.ts"],
args: [Deno.execPath, "run", "-A", "http/racing_server.ts"],
stdout: "piped"
});
// Once racing server is ready it will write to its stdout.
Expand Down
2 changes: 1 addition & 1 deletion installer/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export async function install(

// ensure script that is being installed exists
const ps = run({
args: ["deno", "fetch", "--reload", moduleUrl],
args: [Deno.execPath, "fetch", "--reload", moduleUrl],
stdout: "inherit",
stderr: "inherit"
});
Expand Down
2 changes: 1 addition & 1 deletion installer/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const isWindows = Deno.platform.os === "win";
async function startFileServer(): Promise<void> {
fileServer = run({
args: [
"deno",
Deno.execPath,
"run",
"--allow-read",
"--allow-net",
Expand Down

0 comments on commit 287b0a9

Please sign in to comment.