Skip to content

Commit

Permalink
fix: fix import local file
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed May 8, 2021
1 parent 4ee4800 commit 9b1840f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dzx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ try {
} else if (script.startsWith("http://") || script.startsWith("https://")) {
await import(script);
} else if (script) {
// await import(join($.cwd, script));
const data = await Deno.readTextFile(join($.cwd, script));
await import(`data:application/typescript,${encodeURIComponent(data)}`);
await import("file://" + join($.cwd, script));
} else {
console.error(`usage: dzx <script>`);
Deno.exit(1);
Expand Down

0 comments on commit 9b1840f

Please sign in to comment.