diff --git a/dzx.ts b/dzx.ts index 01850ff..ff6afcd 100755 --- a/dzx.ts +++ b/dzx.ts @@ -1,21 +1,20 @@ /// -import { readAll } from "./deps.ts"; -import { join } from "./deps.ts"; +import { join, readAll } from "./deps.ts"; import { ProcessError } from "./src/process_error.ts"; import { $ } from "./mod.ts"; window.$ = $; -let script: string | undefined = Deno.args[0]; +const script: string | undefined = Deno.args[0]; try { if (!script) { if (!Deno.isatty(Deno.stdin.rid)) { - script = new TextDecoder().decode(await readAll(Deno.stdin)); - if (script) { + const data = new TextDecoder().decode(await readAll(Deno.stdin)); + if (data) { await import( - `data:application/typescript,${encodeURIComponent(script)}` + `data:application/typescript,${encodeURIComponent(data)}` ); } else { console.error(`usage: dzx